RE: [JBoss-dev] 2.4 release(s) & jaws.xml problem
Yes, I think something is broken there. Do you know if the same will happen (no default ds & null pointer) in the main cvs branch? --jason On Mon, 9 Jul 2001, James Cook wrote: > I was experiencing a similar issue with 2.4. If I didn't specify a default > datasource in standardjaws.xml, I was getting a null pointer exception. I > *did* specify a valid datasource in my jaws.xml. > > jim > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Jason > > Dillon > > Sent: Monday, July 09, 2001 9:05 PM > > To: [EMAIL PROTECTED] > > Subject: [JBoss-dev] 2.4 release(s) & jaws.xml problem > > > > > > It looks like the 2.4 releases (I just tested the ones with just > > JBoss) are > > not paying attention to the jaws.xml in deployed files. I am using an > > Oracle8 database, and specifing the datasource and type-map in > > each jaws.xml > > file (which works fine under MAIN and previous versions). > > > > It complains about "type-mapping Hypersonic SQL not found". I > > modified the > > standardjaws.xml to default to Oracle8 and then I get messages saying that > > Oracle8 type-mapping can't be found. > > > > It looks like this is fixed in MAIN, though I am not really sure > > which files > > have changed (perhaps if the mailing list search worked I could find it). > > > > So now I am rather screwed. I updated our usage of JMS in beans > > to use the > > JMS resource adapter (which I belive is a 2.4'ism). I have been > > doing most > > of my work off of main, but now that MDB is non-functional I > > looked into the > > 2.4 release... which MDB works fine, but now entities are messed up. > > > > *hit. > > > > I really need to get our application re-running on JBoss (with > > JMS RA)... or > > I am really screwed. =( > > > > --jason > > > > > > ___ > > Jboss-development mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] 2.4 release(s) & jaws.xml problem
That fine, I was just wondering. --jason On Mon, 9 Jul 2001, James Cook wrote: > Not sure. I am not an active developer on jBoss and I haven't built it in > some time. I was using the 2.4 Beta binary. > > jim > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Jason > > Dillon > > Sent: Monday, July 09, 2001 10:59 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [JBoss-dev] 2.4 release(s) & jaws.xml problem > > > > > > Yes, I think something is broken there. Do you know if the same > > will happen > > (no default ds & null pointer) in the main cvs branch? > > > > --jason > > > > > > On Mon, 9 Jul 2001, James Cook wrote: > > > > > I was experiencing a similar issue with 2.4. If I didn't > > specify a default > > > datasource in standardjaws.xml, I was getting a null pointer > > exception. I > > > *did* specify a valid datasource in my jaws.xml. > > > > > > jim > > > > > > > -Original Message- > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED]]On > > Behalf Of Jason > > > > Dillon > > > > Sent: Monday, July 09, 2001 9:05 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: [JBoss-dev] 2.4 release(s) & jaws.xml problem > > > > > > > > > > > > It looks like the 2.4 releases (I just tested the ones with just > > > > JBoss) are > > > > not paying attention to the jaws.xml in deployed files. I am using an > > > > Oracle8 database, and specifing the datasource and type-map in > > > > each jaws.xml > > > > file (which works fine under MAIN and previous versions). > > > > > > > > It complains about "type-mapping Hypersonic SQL not found". I > > > > modified the > > > > standardjaws.xml to default to Oracle8 and then I get > > messages saying that > > > > Oracle8 type-mapping can't be found. > > > > > > > > It looks like this is fixed in MAIN, though I am not really sure > > > > which files > > > > have changed (perhaps if the mailing list search worked I > > could find it). > > > > > > > > So now I am rather screwed. I updated our usage of JMS in beans > > > > to use the > > > > JMS resource adapter (which I belive is a 2.4'ism). I have been > > > > doing most > > > > of my work off of main, but now that MDB is non-functional I > > > > looked into the > > > > 2.4 release... which MDB works fine, but now entities are messed up. > > > > > > > > *hit. > > > > > > > > I really need to get our application re-running on JBoss (with > > > > JMS RA)... or > > > > I am really screwed. =( > > > > > > > > --jason > > > > > > > > > > > > ___ > > > > Jboss-development mailing list > > > > [EMAIL PROTECTED] > > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > > > > > > ___ > > > Jboss-development mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > > ___ > > Jboss-development mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces BeanProxy.java
User: user57 Date: 01/07/09 21:40:29 Modified:src/main/org/jboss/ejb/plugins/jrmp/interfaces BeanProxy.java Log: o reformat to 3 spaces Revision ChangesPath 1.3 +94 -94 jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/BeanProxy.java Index: BeanProxy.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/BeanProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- BeanProxy.java2001/06/18 20:01:24 1.2 +++ BeanProxy.java2001/07/10 04:40:28 1.3 @@ -19,119 +19,119 @@ * An abstract base proxy class from which all bean proxys extend from. * * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public abstract class BeanProxy extends GenericProxy { -// Constants - + // Constants - -/** Serial Version Identifier. */ -private static final long serialVersionUID = -4177999312297604904L; + /** Serial Version Identifier. */ + private static final long serialVersionUID = -4177999312297604904L; -// Attributes + // Attributes -// Static + // Static -/** {@link EJBObject#getPrimaryKey} method reference. */ -protected static final Method GET_PRIMARY_KEY; + /** {@link EJBObject#getPrimaryKey} method reference. */ + protected static final Method GET_PRIMARY_KEY; -/** {@link EJBObject#getHandle} method reference. */ -protected static final Method GET_HANDLE; + /** {@link EJBObject#getHandle} method reference. */ + protected static final Method GET_HANDLE; -/** {@link EJBObject#getEJBHome} method reference. */ - protected static final Method GET_EJB_HOME; + /** {@link EJBObject#getEJBHome} method reference. */ + protected static final Method GET_EJB_HOME; -/** {@link EJBObject#isIdentical} method reference. */ -protected static final Method IS_IDENTICAL; + /** {@link EJBObject#isIdentical} method reference. */ + protected static final Method IS_IDENTICAL; -/** - * Initialize {@link EJBObject} method references. - */ -static { -try { -final Class[] empty = {}; -final Class type = EJBObject.class; + /** +* Initialize {@link EJBObject} method references. +*/ + static { + try { + final Class[] empty = {}; + final Class type = EJBObject.class; - GET_PRIMARY_KEY = type.getMethod("getPrimaryKey", empty); - GET_HANDLE = type.getMethod("getHandle", empty); - GET_EJB_HOME = type.getMethod("getEJBHome", empty); - IS_IDENTICAL = type.getMethod("isIdentical", new Class[] { type }); -} -catch (Exception e) { -e.printStackTrace(); -throw new ExceptionInInitializerError(e); -} -} + GET_PRIMARY_KEY = type.getMethod("getPrimaryKey", empty); + GET_HANDLE = type.getMethod("getHandle", empty); + GET_EJB_HOME = type.getMethod("getEJBHome", empty); + IS_IDENTICAL = type.getMethod("isIdentical", new Class[] { type }); + } + catch (Exception e) { + e.printStackTrace(); + throw new ExceptionInInitializerError(e); + } + } -// Constructors -- + // Constructors -- -/** - * No-argument constructor for externalization. - */ -public BeanProxy() {} - -/** - * Initialze. - * - * @param name The JNDI name of the container that we proxy for. - * @param container The remote interface of the invoker for which - * this is a proxy for. - * @param optimize True if the proxy will attempt to optimize - * VM-local calls. - */ -protected BeanProxy(final String name, -final ContainerRemote container, -final boolean optimize) -{ -super(name, container, optimize); -} + /** +* No-argument constructor for externalization. +*/ + public BeanProxy() {} + + /** +* Initialze.
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb AutoDeployer.java
User: user57 Date: 01/07/09 21:41:29 Modified:src/main/org/jboss/ejb AutoDeployer.java Log: o using log4j Revision ChangesPath 1.19 +36 -34jboss/src/main/org/jboss/ejb/AutoDeployer.java Index: AutoDeployer.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/AutoDeployer.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- AutoDeployer.java 2001/06/18 20:01:21 1.18 +++ AutoDeployer.java 2001/07/10 04:41:29 1.19 @@ -25,28 +25,29 @@ import javax.management.RuntimeErrorException; import javax.management.RuntimeMBeanException; -import org.jboss.logging.Log; -import org.jboss.util.ServiceMBeanSupport; +import org.apache.log4j.Category; +import org.jboss.util.ServiceMBeanSupport; /** - * The AutoDeployer is used to automatically deploy applications or - * components thereof. + * The AutoDeployer is used to automatically deploy applications or + * components thereof. * - *It can be used on either .jar or .xml files. The AutoDeployer - * can be configured to "watch" one or more files. If they are - * updated they will be redeployed. + * It can be used on either .jar or .xml files. The AutoDeployer + *can be configured to "watch" one or more files. If they are + *updated they will be redeployed. * - *If it is set to watch a directory instead of a single file, - * all files within that directory will be watched separately. + * If it is set to watch a directory instead of a single file, + *all files within that directory will be watched separately. * - *When a file is to be deployed, the AutoDeployer will use the - * configured deployer to deploy it. + * When a file is to be deployed, the AutoDeployer will use the + *configured deployer to deploy it. * - * @see org.jboss.deployment.J2eeDeployer - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp - * @version $Revision: 1.18 $ + * @see org.jboss.deployment.J2eeDeployer + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.19 $ */ public class AutoDeployer extends ServiceMBeanSupport @@ -56,6 +57,9 @@ // Attributes + /** Instance logger. */ + private Category log = Category.getInstance(this.getClass()); + // Callback to the JMX agent MBeanServer server; @@ -175,12 +179,11 @@ if (url.getProtocol().startsWith("file") && ! new File(url.getFile()).exists()) { // the file does not exist anymore. undeploy - log.log("Auto undeploy of "+url); + log.info("Auto undeploy of "+url); try { undeploy(url.toString(), deployment.deployerName); } catch (Exception e) { - log.error("Undeployment failed"); - log.exception(e); + log.error("Undeployment failed", e); } deployedURLs.remove(url); @@ -210,15 +213,14 @@ // Check old timestamp -- always deploy if first check if ((deployment.lastModified == 0) || (deployment.lastModified < lm)) { - log.log("Auto deploy of "+deployment.url); + log.info("Auto deploy of "+deployment.url); deployment.lastModified = lm; try { deploy(deployment.url.toString(), deployment.deployerName); } catch (Throwable e) { - log.error("Deployment failed:"+deployment.url); - log.exception(e); + log.error("Deployment failed:"+deployment.url, e); // Deployment failed - won't retry until updated } @@ -226,22 +228,22 @@ } } catch (Exception e) { -e.printStackTrace(System.err); - - // Stop auto deployer +log.fatal("auto deployer failure; can not continue", e); +// Stop auto deployer running = false; } } while(running); } // ServiceMBeanSupport overrides - + public String getName() {
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb CacheKey.java
User: user57 Date: 01/07/09 21:42:58 Modified:src/main/org/jboss/ejb CacheKey.java Log: o using log4j when initalization failes, this is not a field so it will not affect serialization... but it should probably be replaced by a nested runtime exception. Revision ChangesPath 1.14 +51 -40jboss/src/main/org/jboss/ejb/CacheKey.java Index: CacheKey.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/CacheKey.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- CacheKey.java 2001/06/18 20:01:21 1.13 +++ CacheKey.java 2001/07/10 04:42:58 1.14 @@ -1,58 +1,62 @@ - - /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb; +import java.io.Externalizable; import java.rmi.MarshalledObject; +import org.apache.log4j.Category; + /** -* CacheKey -* -* CacheKey is an encapsulation of both the PrimaryKey and a cache specific key -* -* This implementation is a safe implementation in the sense that it doesn't rely -* on the user supplied hashcode and equals. It is also fast since the hashCode operation -* is pre-calculated. -* -* @see org.jboss.ejb.plugins.NoPassivationInstanceCache.java -* @see org.jboss.ejb.plugins.EntityInstanceCache -* @see org.jboss.ejb.plugins.EntityProxy -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @author Bill Burke -* @version $Revision: 1.13 $ -*/ + * CacheKey is an encapsulation of both the PrimaryKey and a + * cache specific key. + * + * This implementation is a safe implementation in the sense that it + *doesn't rely on the user supplied hashcode and equals. It is also + *fast since the hashCode operation is pre-calculated. + * + * @see org.jboss.ejb.plugins.NoPassivationInstanceCache.java + * @see org.jboss.ejb.plugins.EntityInstanceCache + * @see org.jboss.ejb.plugins.EntityProxy + * + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author Bill Burke + * @version $Revision: 1.14 $ + */ public class CacheKey -implements java.io.Externalizable +implements Externalizable { // Constants - // Attributes - -// The database primaryKey -// This primaryKey is used by -// -// org.jboss.ejb.plugins.EntityInstanceCache.setKey() - to set the EntityEnterpriseContext id -// org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(): -// - implementing Entity.toString() --> cacheKey.getId().toString() -// - implementing Entity.hashCode() --> cacheKey.getId().hashCode() -// - etc... -// org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.EntityProxy.getId() -// + +/** + * The database primaryKey. + * + * This primaryKey is used by: + * + * org.jboss.ejb.plugins.EntityInstanceCache.setKey() - to set the EntityEnterpriseContext id + * org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(): + * - implementing Entity.toString() --> cacheKey.getId().toString() + * - implementing Entity.hashCode() --> cacheKey.getId().hashCode() + * - etc... + * org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.EntityProxy.getId() + */ protected Object id; + public Object getId() { return id; } -// The Marshalled Object representing the key +/** The Marshalled Object representing the key */ protected MarshalledObject mo; -// The Marshalled Object's hashcode +/** The Marshalled Object's hashcode */ protected int hashCode; // Static @@ -60,10 +64,11 @@ // Public public CacheKey() { - // For externalization only + // For externalization only } + public CacheKey(Object id) { - +// why does this throw an error and not an IllegalArgumentException ? if (id == null) throw new Error("id may not be null"); this.id = null; @@ -77,7 +82,14 @@ // Precompute the hashCode (speed) hashCode = mo.hashCode(); } - catch (Exception e) {e.printStackTrace();} + catch (Exception e) { + // + // should probably throw a nested exception here, but + // for now instead of printStackTrace, lets log it +
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb Interceptor.java
User: user57 Date: 01/07/09 21:46:30 Modified:src/main/org/jboss/ejb Interceptor.java Log: o added some javadocs Revision ChangesPath 1.6 +34 -15jboss/src/main/org/jboss/ejb/Interceptor.java Index: Interceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Interceptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Interceptor.java 2001/06/18 20:01:21 1.5 +++ Interceptor.java 2001/07/10 04:46:30 1.6 @@ -10,27 +10,46 @@ import java.security.Principal; /** - * + * Provides the interface for all container interceptors. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.6 $ */ public interface Interceptor extends ContainerPlugin { - // Constants - - - // Static + /** +* Set the next interceptor in the chain. +* +* @param interceptorThe next interceptor in the chain. +*/ + void setNext(Interceptor interceptor); - // Public - public void setNext(Interceptor interceptor); - public Interceptor getNext(); + /** +* Get the next interceptor in the chain. +* +* @return The next interceptor in the chain. +*/ + Interceptor getNext(); - public Object invokeHome(MethodInvocation mi) - throws Exception; - - public Object invoke(MethodInvocation mi) - throws Exception; + /** +* ??? +* +* @param mi ??? +* @return ??? +* +* @throws Exception ??? +*/ + Object invokeHome(MethodInvocation mi) throws Exception; + + /** +* ??? +* +* @param mi ??? +* @return ??? +* +* @throws Exception ??? +*/ + Object invoke(MethodInvocation mi) throws Exception; } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/perf/test TestProbe.java
User: user57 Date: 01/07/09 22:01:47 Modified:src/main/org/jboss/test/perf/test TestProbe.java Log: o forgot about this one, changed deployment to a test Revision ChangesPath 1.3 +96 -97jbosstest/src/main/org/jboss/test/perf/test/TestProbe.java Index: TestProbe.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/TestProbe.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestProbe.java2001/07/06 02:29:21 1.2 +++ TestProbe.java2001/07/10 05:01:47 1.3 @@ -16,12 +16,14 @@ import org.jboss.test.util.Deploy; -/** Test of EJB call invocation overhead. - -@author [EMAIL PROTECTED] -@version $Revision: 1.2 $ -*/ -public class TestProbe extends junit.framework.TestCase +/** + * Test of EJB call invocation overhead. + * + * @author [EMAIL PROTECTED] + * @version $Revision: 1.3 $ + */ +public class TestProbe + extends TestCase { static int N = 1000; @@ -31,100 +33,97 @@ } protected void setUp() throws Exception + { + // Deploy.deploy("perf.jar"); + } + + public void testTimings() throws Exception { - // Deploy.deploy("perf.jar"); + System.out.println("+++ testTimings()"); + InitialContext jndiContext = new InitialContext(); + Object obj = jndiContext.lookup("Probe"); + obj = PortableRemoteObject.narrow(obj, ProbeHome.class); + ProbeHome home = (ProbeHome) obj; + System.out.println("Found ProbeHome @ jndiName=Probe"); + Probe bean = home.create(); + System.out.println("Created Probe"); + warmup(bean); + noop(bean); + ping(bean); + echo(bean); } -public void testTimings() throws Exception -{ -System.out.println("+++ testTimings()"); -InitialContext jndiContext = new InitialContext(); -Object obj = jndiContext.lookup("Probe"); -obj = PortableRemoteObject.narrow(obj, ProbeHome.class); -ProbeHome home = (ProbeHome) obj; -System.out.println("Found ProbeHome @ jndiName=Probe"); -Probe bean = home.create(); -System.out.println("Created Probe"); -warmup(bean); -noop(bean); -ping(bean); -echo(bean); -} - -public void testTimingsCMT() throws Exception -{ -System.out.println("+++ testTimingsCMT()"); -InitialContext jndiContext = new InitialContext(); -Object obj = jndiContext.lookup("ProbeCMT"); -obj = PortableRemoteObject.narrow(obj, ProbeHome.class); -ProbeHome home = (ProbeHome) obj; -System.out.println("Found ProbeHome @ jndiName=ProbeCMT"); -Probe bean = home.create(); -System.out.println("Created ProbeCMT"); -warmup(bean); -noop(bean); -ping(bean); -echo(bean); -} + public void testTimingsCMT() throws Exception + { + System.out.println("+++ testTimingsCMT()"); + InitialContext jndiContext = new InitialContext(); + Object obj = jndiContext.lookup("ProbeCMT"); + obj = PortableRemoteObject.narrow(obj, ProbeHome.class); + ProbeHome home = (ProbeHome) obj; + System.out.println("Found ProbeHome @ jndiName=ProbeCMT"); + Probe bean = home.create(); + System.out.println("Created ProbeCMT"); + warmup(bean); + noop(bean); + ping(bean); + echo(bean); + } -private void warmup(Probe bean) throws Exception -{ - bean.noop(); - bean.ping("Ping"); - bean.echo("Echo"); -} - -private void noop(Probe bean) throws Exception -{ -System.out.println("Starting "+N+" noop() invocations"); -long start = System.currentTimeMillis(); -for(int n = 0; n < N; n ++) - bean.noop(); -long end = System.currentTimeMillis(); -long elapsed = end - start; -System.out.println(N+" noop() invocations = "+elapsed+" ms, "+(elapsed / N)+" ms/noop"); -} -private void ping(Probe bean) throws Exception -{ -System.out.println("Starting "+N+" ping(PING) invocations"); -long start = System.currentTimeMillis(); -for(int n = 0; n < N; n ++) - bean.ping("PING"); -long end = System.currentTimeMillis(); -long elapsed = end - start; -System.out.println(N+" ping() invocations = "+elapsed+" ms, "+(elapsed / N)+" ms/noop"); -} -private void echo(Probe bean) throws Exception -{ -System.out.println("Starting "+N+" echo(ECHO) invocations"); -long start = System.currentTimeMillis(); -for(int n = 0; n < N; n ++) -{ - String echo = bean.ech
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins AbstractInterceptor.java SecurityProxyInterceptor.java
User: user57 Date: 01/07/09 22:03:17 Modified:src/main/org/jboss/ejb/plugins AbstractInterceptor.java SecurityProxyInterceptor.java Log: o documented AbstractInterceptor a bit more. o changed logging in SecurityProxyInterceptor to log4j Revision ChangesPath 1.6 +30 -22jboss/src/main/org/jboss/ejb/plugins/AbstractInterceptor.java Index: AbstractInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractInterceptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AbstractInterceptor.java 2001/06/18 20:01:23 1.5 +++ AbstractInterceptor.java 2001/07/10 05:03:16 1.6 @@ -13,11 +13,11 @@ import org.jboss.ejb.MethodInvocation; /** - * + * An abstract base class for container interceptors. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.6 $ */ public abstract class AbstractInterceptor implements Interceptor @@ -25,6 +25,8 @@ // Constants - // Attributes + + /** The next interceptor in the chain. */ protected Interceptor nextInterceptor; // Static @@ -34,39 +36,45 @@ // Public // Interceptor implementation + public abstract void setContainer(Container container); + public abstract Container getContainer(); - public void setNext(Interceptor interceptor) { nextInterceptor = interceptor; } - public Interceptor getNext() { return nextInterceptor; } + + public void setNext(final Interceptor interceptor) { + // assert interceptor != null + nextInterceptor = interceptor; + } - public void init() - throws Exception - { + public Interceptor getNext() { + return nextInterceptor; + } + + public void init() throws Exception { + // empty } - public void start() - throws Exception - { + public void start() throws Exception { + // empty } - public void stop() - { + public void stop() { + // empty } - public void destroy() - { + public void destroy() { + // empty } - public Object invokeHome(MethodInvocation mi) - throws Exception - { + public Object invokeHome(final MethodInvocation mi) throws Exception { + // assert mi != null; return getNext().invokeHome(mi); } - public Object invoke(MethodInvocation mi) - throws Exception - { + public Object invoke(final MethodInvocation mi) throws Exception { + // assert mi != null; return getNext().invoke(mi); } + // Protected - } 1.4 +149 -138 jboss/src/main/org/jboss/ejb/plugins/SecurityProxyInterceptor.java Index: SecurityProxyInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/SecurityProxyInterceptor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SecurityProxyInterceptor.java 2001/06/18 20:01:23 1.3 +++ SecurityProxyInterceptor.java 2001/07/10 05:03:16 1.4 @@ -12,6 +12,8 @@ import javax.ejb.EJBContext; import javax.naming.InitialContext; +import org.apache.log4j.Category; + import org.jboss.ejb.Container; import org.jboss.ejb.ContainerInvokerContainer; import org.jboss.ejb.EnterpriseContext; @@ -21,147 +23,156 @@ import org.jboss.security.SecurityProxy; import org.jboss.security.SecurityProxyFactory; -/** The SecurityProxyInterceptor is where the EJB custom security proxy -integration is performed. This interceptor is dynamically added to container -interceptors when the deployment descriptors specifies a security -proxy. It is added just before the container interceptor so that the -interceptor has access to the EJB instance and context. - -@author mailto:[EMAIL PROTECTED]";>Scott Stark. -@version $Revision: 1.3 $ -*/ -public class SecurityProxyInterceptor extends AbstractInterceptor +/** + * The SecurityProxyInterceptor is where the EJB custom security proxy + * integration is performed. This interceptor is dynamically added to container + * interceptors when the deployment
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins LRUEnterpriseContextCachePolicy.java
User: user57 Date: 01/07/09 22:08:04 Modified:src/main/org/jboss/ejb/plugins LRUEnterpriseContextCachePolicy.java Log: o reformat Revision ChangesPath 1.10 +553 -491 jboss/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java Index: LRUEnterpriseContextCachePolicy.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- LRUEnterpriseContextCachePolicy.java 2001/07/03 23:19:19 1.9 +++ LRUEnterpriseContextCachePolicy.java 2001/07/10 05:08:04 1.10 @@ -26,515 +26,577 @@ * * @see AbstractInstanceCache * @author mailto:[EMAIL PROTECTED]";>Simone Bordet - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ */ -public class LRUEnterpriseContextCachePolicy extends LRUCachePolicy - implements EnterpriseContextCachePolicy, XmlLoadable, Monitorable +public class LRUEnterpriseContextCachePolicy + extends LRUCachePolicy + implements EnterpriseContextCachePolicy, XmlLoadable, Monitorable { - // Constants - + // Constants - - // Attributes - /* The AbstractInstanceCache that uses this cache policy */ - private AbstractInstanceCache m_cache; - /* The period of the resizer's runs */ - private long m_resizerPeriod; - /* The period of the overager's runs */ - private long m_overagerPeriod; - /* The age after which a bean is automatically passivated */ - private long m_maxBeanAge; - /* Enlarge cache capacity if there is a cache miss every or less this member's value */ - private long m_minPeriod; - /* Shrink cache capacity if there is a cache miss every or more this member's value */ - private long m_maxPeriod; - /* The resizer will always try to keep the cache capacity so - * that the cache is this member's value loaded of cached objects */ - private double m_factor; - /* The overager timer task */ - private TimerTask m_overager; - /* The resizer timer task */ - private TimerTask m_resizer; - /* Useful for log messages */ - private StringBuffer m_buffer = new StringBuffer(); - - - // Static - - // Constructors -- - /** - * Creates a LRU cache policy object given the instance cache that use - * this policy object. - */ - public LRUEnterpriseContextCachePolicy(AbstractInstanceCache eic) - { - if (eic == null) throw new IllegalArgumentException("Instance cache argument cannot be null"); - m_cache = eic; - } - - // Public - - // Monitorable implementation - public void sample(Object s) - { - BeanCacheSnapshot snapshot = (BeanCacheSnapshot)s; - LRUList list = getList(); - synchronized (m_cache.getCacheLock()) - { - snapshot.m_cacheMinCapacity = list.m_minCapacity; - snapshot.m_cacheMaxCapacity = list.m_maxCapacity; - snapshot.m_cacheCapacity = list.m_capacity; - snapshot.m_cacheSize = list.m_count; - } - } - - // Z implementation -- - public void start() throws Exception - { - if (m_resizerPeriod > 0) - { - m_resizer = new ResizerTask(m_resizerPeriod); - scheduler.schedule(m_resizer, (long)(Math.random() * m_resizerPeriod)); - } + // Attributes + + /** The AbstractInstanceCache that uses this cache policy */ + private AbstractInstanceCache m_cache; + + /** The period of the resizer's runs */ + private long m_resizerPeriod; + + /** The period of the overager's runs */ + private long m_overagerPeriod; + + /** The age after which a bean is automatically passivated */ + private long m_maxBeanAge; + + /** +* Enlarge cache capacity if there is a cache miss every or less +* this member's value +*/ + private long m_minPeriod; + + /** +* Shrink cache capacity if there is a cache miss every or more +* this member's value +*/ + private long m_maxPeriod; + + /** +* The resizer will
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EnterpriseContext.java
User: user57 Date: 01/07/09 22:09:20 Modified:src/main/org/jboss/ejb EnterpriseContext.java Log: o using log4j o updated comments to be javadocs Revision ChangesPath 1.37 +170 -166 jboss/src/main/org/jboss/ejb/EnterpriseContext.java Index: EnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EnterpriseContext.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- EnterpriseContext.java2001/07/03 22:38:27 1.36 +++ EnterpriseContext.java2001/07/10 05:09:20 1.37 @@ -1,4 +1,3 @@ - /* * JBoss, the OpenSource EJB server * @@ -28,65 +27,77 @@ import javax.transaction.RollbackException; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; + +import org.apache.log4j.Category; -import org.jboss.logging.Logger; import org.jboss.metadata.ApplicationMetaData; import org.jboss.metadata.SecurityRoleRefMetaData; import org.jboss.security.RealmMapping; import org.jboss.security.SimplePrincipal; /** - * The EnterpriseContext is used to associate EJB instances with metadata about it. + * The EnterpriseContext is used to associate EJB instances with + * metadata about it. * - * @see StatefulSessionEnterpriseContext - * @see StatelessSessionEnterpriseContext - * @see EntityEnterpriseContext - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury - * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini - * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors - * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard - * @version $Revision: 1.36 $ + * @see StatefulSessionEnterpriseContext + * @see StatelessSessionEnterpriseContext + * @see EntityEnterpriseContext + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini + * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors + * @author mailto:[EMAIL PROTECTED]";>Ole Husgaard + * @version $Revision: 1.37 $ * - * Revisions: - * 2001/06/29: marcf - * - Added txLock to permit locking and most of all notifying on tx demarcation only + * Revisions: + * 2001/06/29: marcf + * - Added txLock to permit locking and most of all notifying on tx + * demarcation only */ public abstract class EnterpriseContext { // Constants - // Attributes -// The EJB instanfce + + /** Instance logger. */ + private Category log = Category.getInstance(this.getClass()); + + /** The EJB instance */ Object instance; -// The container using this context + /** The container using this context */ Container con; -// Set to the synchronization currently associated with this context. May be null + /** +* Set to the synchronization currently associated with this context. +* May be null +*/ Synchronization synch; - // The transaction associated with the instance + /** The transaction associated with the instance */ Transaction transaction; - // The principal associated with the call + /** The principal associated with the call */ private Principal principal; - // The principal for the bean associated with the call + /** The principal for the bean associated with the call */ private Principal beanPrincipal; -// Only StatelessSession beans have no Id, stateful and entity do + /** Only StatelessSession beans have no Id, stateful and entity do */ Object id; - // The instance is being used. This locks it's state + /** The instance is being used. This locks it's state */ int locked = 0; - // The instance is used in a transaction, synchronized methods on the tx - Object txLock = new Object(); + /** The instance is used in a transaction, synchronized methods on the tx */ + Object txLock = new Object(); // Static // Constructors -- + public EnterpriseContext(Object instance, Container con) { this.instance = instance; @@ -94,97 +105,93 @@ } // Public + public Object getInstance() -{ - return instance; -} + { + return instance; + } /** * Gets the container that manages the wrapped bean. */ public Container getC
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb Container.java
User: user57 Date: 01/07/09 22:10:54 Modified:src/main/org/jboss/ejb Container.java Log: o changed logging to log4j o changed some comments to javadocs Revision ChangesPath 1.47 +212 -195 jboss/src/main/org/jboss/ejb/Container.java Index: Container.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Container.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- Container.java2001/06/24 03:06:45 1.46 +++ Container.java2001/07/10 05:10:54 1.47 @@ -40,7 +40,8 @@ import javax.transaction.TransactionManager; import javax.sql.DataSource; -import org.jboss.logging.Logger; +import org.apache.log4j.Category; + import org.jboss.security.EJBSecurityManager; import org.jboss.security.RealmMapping; @@ -59,21 +60,23 @@ import org.jboss.ejb.plugins.local.BaseLocalContainerInvoker; /** - *This is the base class for all EJB-containers in JBoss. A Container - *functions as the central hub of all metadata and plugins. Through this - *the container plugins can get hold of the other plugins and any metadata they need. - * - *The ContainerFactory creates instances of subclasses of this class and calls the appropriate - *initialization methods. + * This is the base class for all EJB-containers in JBoss. A Container + * functions as the central hub of all metadata and plugins. Through this + * the container plugins can get hold of the other plugins and any metadata + * they need. * - *A Container does not perform any significant work, but instead delegates to the plugins to provide for - *all kinds of algorithmic functionality. + * The ContainerFactory creates instances of subclasses of this class + *and calls the appropriate initialization methods. + * + * A Container does not perform any significant work, but instead delegates + *to the plugins to provide for all kinds of algorithmic functionality. * - * @see ContainerFactory - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury - * @author mailto:[EMAIL PROTECTED]";>Scott Stark. - * @version $Revision: 1.46 $ + * @see ContainerFactory + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author mailto:[EMAIL PROTECTED]";>Scott Stark. + * @version $Revision: 1.47 $ */ public abstract class Container { @@ -81,47 +84,61 @@ // Attributes - // This is the application that this container is a part of + /** Instance logger. */ + protected Category log = Category.getInstance(this.getClass()); + + /** This is the application that this container is a part of */ protected Application application; - // This is the local classloader of this container. Used for loading resources that - // must come from the local jar file for the container. NOT for loading classes! + /** +* This is the local classloader of this container. Used for loading +* resources that must come from the local jar file for the container. +* NOT for loading classes! +*/ protected ClassLoader localClassLoader; - // This is the classloader of this container. All classes and resources that - // the bean uses will be loaded from here. By doing this we make the bean re-deployable + /** +* This is the classloader of this container. All classes and resources that +* the bean uses will be loaded from here. By doing this we make the bean +* re-deployable +*/ protected ClassLoader classLoader; - // This is the new metadata. it includes information from both ejb-jar and jboss.xml - // the metadata for the application can be accessed trough metaData.getApplicationMetaData() + /** +* This is the new metadata. it includes information from both ejb-jar and +* jboss.xml the metadata for the application can be accessed trough +* metaData.getApplicationMetaData() +*/ protected BeanMetaData metaData; - // This is the EnterpriseBean class + /** This is the EnterpriseBean class */ protected Class beanClass; - // This is the TransactionManager + /** This is the TransactionManager */ protected TransactionManager tm; - // This is the SecurityManager + /** This is the SecurityManager */ protected EJBSecurityManager sm; - // This is the realm mapping + /** This is the realm mapping */ protected RealmMapping rm; /** The custom security proxy used by the SecurityInterceptor */ protected Object securityProxy; - + + /** ??? */ protected LocalContainerInvoker localC
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins StatefulSessionInstanceInterceptor.java
User: user57 Date: 01/07/09 22:06:40 Modified:src/main/org/jboss/ejb/plugins StatefulSessionInstanceInterceptor.java Log: o using log4j to report errors o throwing a ExceptionInInitializerError rather than leave the system in an unstable state at the very rare occurance of exceptions thrown from the static initalizer. Revision ChangesPath 1.18 +340 -321 jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java Index: StatefulSessionInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionInstanceInterceptor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- StatefulSessionInstanceInterceptor.java 2001/07/04 22:50:12 1.17 +++ StatefulSessionInstanceInterceptor.java 2001/07/10 05:06:40 1.18 @@ -1,14 +1,24 @@ /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb.plugins; import java.lang.reflect.Method; import java.rmi.RemoteException; +import javax.transaction.Transaction; +import javax.transaction.RollbackException; +import javax.transaction.Status; +import javax.transaction.Synchronization; + +import javax.ejb.EJBException; +import javax.ejb.EJBObject; + +import org.apache.log4j.Category; + import org.jboss.ejb.Container; import org.jboss.ejb.InstanceCache; import org.jboss.ejb.InstancePool; @@ -16,357 +26,366 @@ import org.jboss.ejb.StatefulSessionEnterpriseContext; import org.jboss.ejb.EnterpriseContext; import org.jboss.ejb.MethodInvocation; -import org.jboss.logging.Logger; import org.jboss.metadata.SessionMetaData; import org.jboss.util.Sync; -import javax.transaction.Transaction; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.Synchronization; -import javax.ejb.EJBException; -import javax.ejb.EJBObject; - - /** -* This container acquires the given instance. -* -* @see -* @author mailto:[EMAIL PROTECTED]";>Rickard Öberg -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @version $Revision: 1.17 $ -* -* Revisions: -* 20010704 marcf -* -* - Moved to new synchronization -* -*/ + * This container acquires the given instance. + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.18 $ + * + * Revisions: + * 20010704 marcf + * + * - Moved to new synchronization + * + */ public class StatefulSessionInstanceInterceptor -extends AbstractInterceptor + extends AbstractInterceptor { - // Constants + // Constants - // Attributes --- - protected StatefulSessionContainer container; + // Attributes --- + + /** Instance logger. */ + protected Category log = Category.getInstance(this.getClass()); + + protected StatefulSessionContainer container; - // Static --- - private static Method getEJBHome; - private static Method getHandle; - private static Method getPrimaryKey; - private static Method isIdentical; - private static Method remove; - static - { - try - { - Class[] noArg = new Class[0]; - getEJBHome = EJBObject.class.getMethod("getEJBHome", noArg); - getHandle = EJBObject.class.getMethod("getHandle", noArg); - getPrimaryKey = EJBObject.class.getMethod("getPrimaryKey", noArg); - isIdentical = EJBObject.class.getMethod("isIdentical", new Class[] {EJBObject.class}); - remove = EJBObject.class.getMethod("remove", noArg); - } - catch (Exception x) {x.printStackTrace();} - } - - // Constructors - - - // Public --- - - public void setContainer(Container container) - { - this.container = (StatefulSessionContainer)container; - } - - public Container getContainer() - { - return container; - } - // Interceptor implementation ---
[JBoss-dev] recent changes
You might have noticed that I have commit a lot of changed recently. I am trying to eliminate the usage of Throwable.printStackTrace() but replacing them with valid Log4j logging calls. The point is to help debugging by properly logging exceptions. I have run into a few places where it was unclear where the exception was coming from (originated or was printed). Along the way I have taken the liberty to re-indent. The philosophy here is that if the indentation is wildly off (like it is in many places) it could make it harder to track down a problem, and can lead to problems due to folks misinterpreting the indentation. I have also changed alot of // to /** */ for fields and methods, so those comments can be understood javadoc. Just to give you that safe, warm and fuzy feeling, I run the testsuite several times before I commit any of these changes, just in case. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] JBossMQ and Log4j
I am not so sure that is a safe assumption. For example, the testsuite does not currently setup any logging on the clients. So if JBossMQ used Log4j in its client code, the current testsuite will produce a lot of garbage messages about needing some configuration. There is also the issue of serialization. Category is not serializable, so special care needs to be taken for those classes which need to log, but also need to be serializable. It is really too bad that they did not do this as to avoid the private void readObject(...) overrides that are required to make this work. I have a logging facade which provides all of this niceness and adapts to Log4j (and a custom nexus based system that it originally was based on). I was going to suggest that we make use of it as soon as I was finished with the current refactoring. It provides some convience methods to deal with parameter concatination, logging primitives and handling serialization and such. I wanted to fixed up the Log4j integration, perhaps with a simple autoconfig, that would setup a PrintLogger or NullLogger where Log4j was not available on the client side. Either way, the JBossMQ code should use a more robust logging system. I was going to blanket replace all of the logging in JBossMQ with Log4j until I started running into serialization problems. --jason On Tue, 10 Jul 2001, Hiram Chirino wrote: > > Ah... I did not know that! I've allready moved most of the server over to > log4j. Can I just assume that log4j will be confiurged for me by the > client?? > > Regards, > Hiram > > >From: "Scott M Stark" <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: <[EMAIL PROTECTED]> > >Subject: Re: [JBoss-dev] JBossMQ and Log4j > >Date: Thu, 5 Jul 2001 23:05:01 -0700 > > > >The only reason log4j is not used is because no one has done it. Clients > >are > >already required to use log4j if they want integration with the JBoss > >logging > >facility as of 2.4 so that is not a reason. > > > >- Original Message - > >From: "Jason Dillon" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Thursday, July 05, 2001 9:09 PM > >Subject: [JBoss-dev] JBossMQ and Log4j > > > > > > > Is there any reason why JBossMQ does not use the Log4j api for logging? > >I > > > am having a hard time tracking down this EOFException problem due to > >either > > > the lack of messages or a complete overload of them. If Log4j was used > > > here (with category names set to classnames), I could turn down the > >noise... > > > or at least limit it. > > > > > > The only reason that I can think not to use Log4j is that we then force > > > clients to have Log4j and configure it. Is that such a bad thing? > > > > > > --jason > > > > > > > > > ___ > > > Jboss-development mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > >___ > >Jboss-development mailing list > >[EMAIL PROTECTED] > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] JBossMQ and Log4j
I would say that in the short term that it would be better to have the client code using Log4j, so we can better debug things. In the long term we need to have a way to let the client side logging either automatically disable (perhaps enable with a system property), but either way make use of the same logging api calls. I do not think it is reasonable to assume that all clients will have Log4j configured. --jason On Tue, 10 Jul 2001, Hiram Chirino wrote: > > Yes, but what about on the client side??? Can my client side code also use > log4j?? > > Regards, > Hiram > > >From: "Scott M Stark" <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: <[EMAIL PROTECTED]> > >Subject: Re: [JBoss-dev] JBossMQ and Log4j > >Date: Mon, 9 Jul 2001 23:16:44 -0700 > > > >Log4j will be configured as a service of JBoss. > > > >- Original Message - > >From: "Hiram Chirino" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Sent: Monday, July 09, 2001 10:34 PM > >Subject: Re: [JBoss-dev] JBossMQ and Log4j > > > > > > > > > > Ah... I did not know that! I've allready moved most of the server over > >to > > > log4j. Can I just assume that log4j will be confiurged for me by the > > > client?? > > > > > > Regards, > > > Hiram > > > > > > >From: "Scott M Stark" <[EMAIL PROTECTED]> > > > >Reply-To: [EMAIL PROTECTED] > > > >To: <[EMAIL PROTECTED]> > > > >Subject: Re: [JBoss-dev] JBossMQ and Log4j > > > >Date: Thu, 5 Jul 2001 23:05:01 -0700 > > > > > > > >The only reason log4j is not used is because no one has done it. > >Clients > > > >are > > > >already required to use log4j if they want integration with the JBoss > > > >logging > > > >facility as of 2.4 so that is not a reason. > > > > > > > >___ > >Jboss-development mailing list > >[EMAIL PROTECTED] > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] JBossMQ and Log4j
> Before you go crazy on that log system clean up... I'm working on a major > re-org of the jbossmq module. It's so major that everything is broken right > now on my development box :) I'm making all subsytems in jbossmq a JMX > service. This will be good since jbossmq.xml will then be able to go away. Cool. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Mail Delivery Status Notification
damn these *ucking emails. --jason On 10 Jul 2001, Postmaster wrote: > MAIL ESSENTIALS SENDER NOTIFICATION > > The following message: > > TO: [EMAIL PROTECTED] > FROM:[EMAIL PROTECTED] > DATE: Tue, 10 Jul 2001 20:15:45 +0100 > Subject: Re: [JBoss-dev] IT'S ALIVE! > > > has been quarantined by Mail Essentials for the following reason(s): > > Subject contains word(s)/phrase(s) '! ! !' > > > Mail essentials > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins EntityInstanceInterceptor.java
User: user57 Date: 01/07/10 15:45:41 Modified:src/main/org/jboss/ejb/plugins EntityInstanceInterceptor.java Log: o just a re-intent (no code change) Revision ChangesPath 1.33 +280 -277 jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java Index: EntityInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- EntityInstanceInterceptor.java2001/07/03 23:13:45 1.32 +++ EntityInstanceInterceptor.java2001/07/10 22:45:41 1.33 @@ -1,9 +1,9 @@ /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb.plugins; import java.lang.reflect.Method; @@ -39,317 +39,320 @@ import org.jboss.util.Sync; /** -* -* The instance interceptors role is to acquire a context representing the target object from the -* cache. -* -* This particular container interceptor implements pessimistic locking on the transaction that -* is associated with the retrieved instance. If there is a transaction associated with the -* target component and it is different from the transaction associated with the MethodInvocation -* coming in then the policy is to wait for transactional commit. -* -* We also implement serialization of calls in here (this is a spec requirement). -* This is a fine grained notify, notifyAll mechanism. We notify on ctx serialization locks and -* notifyAll on global transactional locks -* -* WARNING: critical code, get approval from senior developers before changing. -* -* -* @see -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @version $Revision: 1.32 $ -* -* Revisions: -* 2001/06/28: marcf -* -* Moved to new synchronization -* Pools are gone simple design -* two levels of syncrhonization with Tx and ctx -* remove busy wait from previous mechanisms -* -* -*/ + * The instance interceptors role is to acquire a context representing + * the target object from the cache. + * + * This particular container interceptor implements pessimistic locking + *on the transaction that is associated with the retrieved instance. If + *there is a transaction associated with the target component and it is + *different from the transaction associated with the MethodInvocation + *coming in then the policy is to wait for transactional commit. + * + * We also implement serialization of calls in here (this is a spec + *requirement). This is a fine grained notify, notifyAll mechanism. We + *notify on ctx serialization locks and notifyAll on global transactional + *locks. + * + * WARNING: critical code, get approval from senior developers + *before changing. + * + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.33 $ + * + * Revisions: + * 2001/06/28: marcf + * + * Moved to new synchronization + * Pools are gone simple design + * two levels of syncrhonization with Tx and ctx + * remove busy wait from previous mechanisms + * + */ public class EntityInstanceInterceptor -extends AbstractInterceptor + extends AbstractInterceptor { - // Constants - + // Constants - - // Attributes - protected EntityContainer container; + // Attributes + + protected EntityContainer container; - // Static + // Static - // Constructors -- + // Constructors -- - // Public - public void setContainer(Container container) - { - this.container = (EntityContainer)container; - } + // Public + + public void setContainer(Container container) + { + this.container = (EntityContainer)container; + } - public Container getContainer() - { - return container; - } + public Container getContainer() + { + return container;
[JBoss-dev] Getting Transactional contention on contextXXX
I thought I had my app working again, but that was just a dream. =| Does anyone have a clue why I might be getting "Transactional contention on context" messages? I have one thread invoking a session bean in a loop, that session bean creates two entities then queues a JMS message, then returns. This is what I cann the request spooler. I have a mdb reading those messages, performing some action, then responsing to a different queue. On a large job (where each message contains 10k bits of work... not much data, but it takes 10 seconds to build the request) and lets say 50 messages get generated. I am getting about half the way through spooling and then one of the Entities just hangs and as the comments say: note that we use wait() and not wait(5000), why? cause we got cojones, if there a problem in this code we want a freeze not illusion So I have not illusions, it hangs... =( Any clues as to were I might look to fix this? I am fairly sure that it is not an application problem, but there is always a chance. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] More: Getting Transactional contention on contextXXX
Oh ya, the vm the mdb runs in is now wedged and needs to be killed =( --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins EntitySynchronizationInterceptor.java
User: user57 Date: 01/07/10 16:49:14 Modified:src/main/org/jboss/ejb/plugins EntitySynchronizationInterceptor.java Log: o re-indent (no code change) Revision ChangesPath 1.40 +452 -451 jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java Index: EntitySynchronizationInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- EntitySynchronizationInterceptor.java 2001/07/03 23:18:11 1.39 +++ EntitySynchronizationInterceptor.java 2001/07/10 23:49:13 1.40 @@ -1,9 +1,9 @@ /** -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb.plugins; import java.lang.reflect.Method; @@ -40,479 +40,480 @@ import org.jboss.util.Sync; /** -* -* The role of this interceptor is to synchronize the state of the cache with the underlying storage. -* It does this with the ejbLoad and ejbStore semantics of the EJB specification. -* In the presence of a transaction this is triggered by transaction demarcation. -* It registers a callback with the underlying transaction monitor through the JTA interfaces. -* If there is no transaction the policy is to store state upon returning from invocation. -* The synchronization polices A,B,C of the specification are taken care of here. -* -* WARNING: critical code, get approval from senior developers before changing. -* -* -* @see -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @version $Revision: 1.39 $ -* -* Revisions: -* 2001/06/28: marcf -* -* Moved to new synchronization -* afterCompletion doesn't return to pool anymore, idea is to simplify design by not -* mucking with reuse of the instances -* before completion checks for a rolledback tx and doesn't call the store in case of a rollback -* we are notified but we don't register the resource -* -*/ + * The role of this interceptor is to synchronize the state of the cache with + * the underlying storage. It does this with the ejbLoad and ejbStore + * semantics of the EJB specification. In the presence of a transaction this + * is triggered by transaction demarcation. It registers a callback with the + * underlying transaction monitor through the JTA interfaces. If there is no + * transaction the policy is to store state upon returning from invocation. + * The synchronization polices A,B,C of the specification are taken care of + * here. + * + * WARNING: critical code, get approval from senior developers + *before changing. + * + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.40 $ + * + * Revisions: + * 2001/06/28: marcf + * + * Moved to new synchronization + * afterCompletion doesn't return to pool anymore, idea is to simplify + * design by not mucking with reuse of the instances + * before completion checks for a rolledback tx and doesn't call the + * store in case of a rollback we are notified but we don't register + * the resource + * + */ public class EntitySynchronizationInterceptor -extends AbstractInterceptor + extends AbstractInterceptor { - // Constants - + // Constants - - // Attributes + // Attributes - /** - * The current commit option. - */ - protected int commitOption; - - /** - * The refresh rate for commit option d - */ - protected long optionDRefreshRate; - - /** - * The container of this interceptor. - */ - protected EntityContainer container; - - /** - * Optional isModified method - */ - protected Method isModified; - - /** - * For commit option D this is the cache of valid entities - */ - protected HashSet validContexts; - - // Static - - // Constructors -- - - // Public - public void setContainer(Container container) - { - this.container = (EntityContainer)container; - } - - pub
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra JmsManagedConnection.java
User: user57 Date: 01/07/10 17:20:04 Modified:src/main/org/jboss/jms/ra JmsManagedConnection.java Log: o re-indent & fixup javadoc header (no code change) Revision ChangesPath 1.4 +389 -388 jboss/src/main/org/jboss/jms/ra/JmsManagedConnection.java Index: JmsManagedConnection.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ra/JmsManagedConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JmsManagedConnection.java 2001/06/22 05:24:31 1.3 +++ JmsManagedConnection.java 2001/07/11 00:20:04 1.4 @@ -49,426 +49,427 @@ import org.jboss.jms.jndi.JMSProviderAdapter; /** -Managed Connection, manages one or more JMS sessions. - - - - Every ManagedConnection will have a physical JMSConnection under the hood. This may leave out several session, as specifyed in 5.5.4 Multiple Connection Handles. Thread safe semantics is provided. - - Hm. If we are to follow the example in 6.11 this will not work. We would have to use the SAME session. This means we will have to guard against concurrent -access. We use a stack, and only allowes the handle at the top of the stack to do things. - - As to transactions we some fairly hairy alternatives to handle: - XA - we get an XA. We may now only do transaction through the XAResource, since a XASession MUST throw exceptions in commit etc. But since XA support implies LocatTransaction support, we will have to use the XAResource in the LocalTransaction class. - LocalTx - we get a normal session. The LocalTransaction will then work against the normal session api. - - An invokation of JMS MAY BE DONE in none transacted context. What do we do - then? How much should we leave to the user??? - - One possible solution is to use transactions any way, but under the hood. If not LocalTransaction or XA has been aquired by the container, we have to do - the commit in send and publish. (CHECK is the container required to get a XA - every time it uses a managed connection? No its is not, only at creation!) - - Does this mean that a session one time may be used in a transacted env, and - another time in a not transacted. - - Maybe we could have this simple rule: - - If a user is going to use non trans: - - - mark that i ra deployment descr - - Use a JmsProviderAdapter with non XA factorys - - Mark session as non transacted (this defeats the purpose of specifying trans attrinbutes in deploy descr NOT GOOD - - From the JMS tutorial: - "When you create a session in an enterprise bean, the container ignores the arguments you specify, because it manages all transactional properties for enterprise beans." - - And further: - "You do not specify a message acknowledgment mode when you create a message-driven bean that uses container-managed transactions. The container handles -acknowledgment automatically." - -On Session or Connection: - -From Tutorial: -"A JMS API resource is a JMS API connection or a JMS API session." But in the -J2EE spec only connection is considered a resource. - - -Not resolved: connectionErrorOccurred: it is verry hard to know from the -exceptions thrown if it is a connection error. Should we register an -ExceptionListener and mark al handles as errounous? And then let them send the event and throw an exception? + * Managed Connection, manages one or more JMS sessions. + * + * Every ManagedConnection will have a physical JMSConnection under the + *hood. This may leave out several session, as specifyed in 5.5.4 Multiple + *Connection Handles. Thread safe semantics is provided. + * Hm. If we are to follow the example in 6.11 this will not work. We would + *have to use the SAME session. This means we will have to guard against + *concurrent access. We use a stack, and only allowes the handle at the + *top of the stack to do things. * + * As to transactions we some fairly hairy alternatives to handle: + *XA - we get an XA. We may now only do transaction through the + *XAResource, since a XASession MUST throw exceptions in commit etc. But + *since XA support implies LocatTransaction support, we will have to use + *the XAResource in the LocalTransaction class. + *LocalTx - we get a normal session. The LocalTransaction will then work + *against the normal session api. * + * An invokation of JMS MAY BE DONE in none transacted context. What do we do + * then? How much should we leave to the user??? + * + * One possible solution is to use transactions any way, but under the hood. + * If not LocalTransaction or XA has been aquired by the container, we have + * to do the commit in send and publish. (CHECK is the container required to + * get a XA every time it uses a managed connection? No its is not
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra JmsManagedConnectionFactory.java
User: user57 Date: 01/07/10 17:29:08 Modified:src/main/org/jboss/jms/ra JmsManagedConnectionFactory.java Log: o re-indent (no code change) Revision ChangesPath 1.3 +147 -157 jboss/src/main/org/jboss/jms/ra/JmsManagedConnectionFactory.java Index: JmsManagedConnectionFactory.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ra/JmsManagedConnectionFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JmsManagedConnectionFactory.java 2001/06/18 20:01:26 1.2 +++ JmsManagedConnectionFactory.java 2001/07/11 00:29:08 1.3 @@ -44,170 +44,160 @@ * Created: Sat Mar 31 03:08:35 2001 * * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ - -public class JmsManagedConnectionFactory implements ManagedConnectionFactory { - -private PrintWriter logWriter = null; -private String providerJNDI; -private JmsLogger logger = new JmsLogger(); - -//For local access -private JMSProviderAdapter adapter; -public JmsManagedConnectionFactory() { - -} - /** - * Create a "non managed" connection factory. No appserver involved - */ -public Object createConnectionFactory() throws ResourceException -{ -return new JmsConnectionFactoryImpl(this, null); -} - -/** - * Create a ConnectionFactory with appserver hook - */ -public Object createConnectionFactory(ConnectionManager cxManager) -throws ResourceException -{ - return new JmsConnectionFactoryImpl(this, cxManager); -} +public class JmsManagedConnectionFactory + implements ManagedConnectionFactory +{ + private PrintWriter logWriter = null; + private String providerJNDI; + private JmsLogger logger = new JmsLogger(); + + //For local access + private JMSProviderAdapter adapter; + + public JmsManagedConnectionFactory() { + } + + /** +* Create a "non managed" connection factory. No appserver involved +*/ + public Object createConnectionFactory() throws ResourceException + { + return new JmsConnectionFactoryImpl(this, null); + } + + /** +* Create a ConnectionFactory with appserver hook +*/ + public Object createConnectionFactory(ConnectionManager cxManager) + throws ResourceException + { + return new JmsConnectionFactoryImpl(this, cxManager); + } -/** - * Create a new connection to manage in pool - */ -public ManagedConnection createManagedConnection(Subject subject, - ConnectionRequestInfo info) - throws ResourceException -{ - JmsCred cred = JmsCred.getJmsCred(this,subject, info); - // OK we got autentication stuff - JmsManagedConnection mc = new JmsManagedConnection - (this, info,cred.name, cred.pwd); - // Set default logwriter according to spec - mc.setLogWriter(logWriter); - return mc; - -} - -/** - * Match a set of connections from the pool - */ -public ManagedConnection - matchManagedConnections(Set connectionSet, - Subject subject, - ConnectionRequestInfo info) -throws ResourceException { - - // Get cred - JmsCred cred = JmsCred.getJmsCred(this,subject, info); - - // Traverse the pooled connections and look for a match, return - // first found -Iterator connections = connectionSet.iterator(); -while (connections.hasNext()) { -Object obj = connections.next(); + /** +* Create a new connection to manage in pool +*/ + public ManagedConnection createManagedConnection(Subject subject, +ConnectionRequestInfo info) + throws ResourceException + { + JmsCred cred = JmsCred.getJmsCred(this,subject, info); + // OK we got autentication stuff + JmsManagedConnection mc = new JmsManagedConnection + (this, info,cred.name, cred.pwd); + // Set default logwriter according to spec + mc.setLogWriter(logWriter); + return mc; + + } + + /** +* Match a set of connections from the pool +*/ + public ManagedConnection matchManagedConnections(Set connectionSet, +Subject subject, +ConnectionRequestInfo info) + throws ResourceException + { + // Get cred + JmsCred cred = JmsCred.getJmsCred(this,subject, info); + + // Traverse the pooled connections and look for a
[JBoss-dev] possible JBossMQ UIL socket multiplexor race condition
I have been trying to track down this transactional contention, then I ran into a problem where the spooler eventually hung, after a seemingly random number of messages. SpyXAQueueConnection.createXAQueueSession() would not return from SpyConnection.createReceiver(). SpyConnection.createReceiver() would not return from DistributedJMSServerUILClient.setSpyDistributedConnection(). DistributedJMSServerUILClient.setSpyDistributedConnection() would not return from DistributedJMSServerUILClient.waitAnswer(). I spent a few hours adding log messages to track down exactly where it was hanging and that was the in.readbyte() inside of waitAnswer(). So, next I looked at the input stream, which is a DemuxInputStream. I just started adding debug messages and the re-ran my application againts it and it just stop happening. So I am guessing that due to all the io in the log & System.out messages, the window for the race shrunk a little (or a lot, not really sure). Anyways, I am going to see if I can write a test that will reliably cause this to happen. I am starting to wish that I never updated my app to use the JMS resource adapter... so I could still run off of 2.2.x =( --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] more contention fluff
Well, I have not been able to track it down fully, but I modified the locktest to be a bit more agressive. First I simply up'd the thread and iteration count (which could cause a NullPointerException in the entity syncrhonization interceptor... but not all the time). It will also hang some times, and then sometimes it will just run fine. I was not sure if the commit-option had anything todo with it, so I expanded the test to run over each commit option. With the thread count low (10 or so), option a and b work, but when it comes to c it never makes it through, the test just hangs. I have no idea what happens with option d. All the while it produces a lot (alot of transactional contention on contextXXX) messages, which makes sence. I also changed the test to actually assert if the test failed. Unfortunatly, the test will timeout and not be included in the report... not really sure why that is, but it is. *sigh* I was hoping to reproduce what I am seeing with this test, but it has not turned out that way. I can not even tune the test to fail each time... I really need a drink. It does fail though... with a hang or null pointer. Anyways, I commented out the c & d tests for now since they cause the report not to show up and I turned the thread count down to 10 and iter to 20. Someone who knows a little more about the locking mechanism (marc?) might want to play with this test a little to see where it hangs and where the null is thrown. I ended up using the RMI IL for now, but I think that I still get a contention/hang after a while =( --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/lock/interfaces EnterpriseEntity.java
User: user57 Date: 01/07/10 22:52:08 Modified:src/main/org/jboss/test/lock/interfaces EnterpriseEntity.java Log: o updated lock test to excersise commit-option a, b (c & d but those are not enabled at the moment). o abstracted the actuall test outside of Worker, into Task so it is easier to add new lock tests o the test will also do a single bean, bean-to-bean Revision ChangesPath 1.3 +9 -7 jbosstest/src/main/org/jboss/test/lock/interfaces/EnterpriseEntity.java Index: EnterpriseEntity.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/lock/interfaces/EnterpriseEntity.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EnterpriseEntity.java 2000/10/19 01:28:07 1.2 +++ EnterpriseEntity.java 2001/07/11 05:52:08 1.3 @@ -1,16 +1,18 @@ package org.jboss.test.lock.interfaces; - import javax.ejb.*; import java.rmi.*; +public interface EnterpriseEntity + extends EJBObject +{ + void setField(String value) throws RemoteException; + + void setNextEntity(String nextBeanName) throws RemoteException; + void setAndCopyField(String value) throws RemoteException; -public interface EnterpriseEntity extends EJBObject { - - public void setField(String value) throws RemoteException; - public void setNextEntity(String nextBeanName) throws RemoteException; - public void setAndCopyField(String value) throws RemoteException; - public String getField() throws RemoteException; + String getField() throws RemoteException; + void sleep(long time) throws InterruptedException, RemoteException; } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/lock/bean EnterpriseEntityBean.java
User: user57 Date: 01/07/10 22:52:08 Modified:src/main/org/jboss/test/lock/bean EnterpriseEntityBean.java Log: o updated lock test to excersise commit-option a, b (c & d but those are not enabled at the moment). o abstracted the actuall test outside of Worker, into Task so it is easier to add new lock tests o the test will also do a single bean, bean-to-bean Revision ChangesPath 1.3 +86 -70 jbosstest/src/main/org/jboss/test/lock/bean/EnterpriseEntityBean.java Index: EnterpriseEntityBean.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/lock/bean/EnterpriseEntityBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EnterpriseEntityBean.java 2000/10/19 01:28:06 1.2 +++ EnterpriseEntityBean.java 2001/07/11 05:52:08 1.3 @@ -6,80 +6,96 @@ import org.jboss.test.lock.interfaces.EnterpriseEntityHome; import org.jboss.test.lock.interfaces.EnterpriseEntity; -public class EnterpriseEntityBean implements EntityBean { - private EntityContext entityContext; - public String name; - public String field; - public EnterpriseEntity nextEntity; - - public String ejbCreate(String name) throws RemoteException, CreateException { - this.name = name; - return null; - } - - public void ejbPostCreate(String name) throws RemoteException, CreateException { - } - - - public void ejbActivate() throws RemoteException { - } - - public void ejbLoad() throws RemoteException { - } - - public void ejbPassivate() throws RemoteException { - } - - public void ejbRemove() throws RemoteException, RemoveException { - } - - public void ejbStore() throws RemoteException { - } - - - public void setField(String field) throws RemoteException { - System.out.println("Bean "+name+", setField("+field+") called"); - this.field = field; - } - - public String getField() throws RemoteException { - return field; - } +public class EnterpriseEntityBean + implements EntityBean +{ + private EntityContext entityContext; + + public String name; + public String field; + public EnterpriseEntity nextEntity; + + public String ejbCreate(final String name) + throws RemoteException, CreateException + { + this.name = name; + return null; + } + + public void ejbPostCreate(String name) + throws RemoteException, CreateException + { + // empty + } + + public void ejbActivate() throws RemoteException { + // empty + } + + public void ejbLoad() throws RemoteException { + // empty + } + + public void ejbPassivate() throws RemoteException { + // empty + } + + public void ejbRemove() throws RemoteException, RemoveException { + // empty + } + + public void ejbStore() throws RemoteException { + // empty + } + + public void setField(String field) throws RemoteException { + System.out.println("Bean "+name+", setField("+field+") called"); + this.field = field; + } + + public String getField() throws RemoteException { + return field; + } - - public void setAndCopyField(String field) throws RemoteException { - System.out.println("Bean "+name+", setAndCopyField("+field+") called"); + public void setAndCopyField(String field) throws RemoteException { + System.out.println("Bean "+name+", setAndCopyField("+field+") called"); - setField(field); - nextEntity.setField(field); - } + setField(field); + nextEntity.setField(field); + } - - public void setNextEntity(String beanName) throws RemoteException { - - System.out.println("EntityBean.createEntity() called"); + public void setNextEntity(String beanName) throws RemoteException { + System.out.println("EntityBean.createEntity() called"); - try { - EJBObject ejbObject = entityContext.getEJBObject(); - EnterpriseEntityHome home = (EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome(); + try { + EJBObject ejbObject = entityContext.getEJBObject(); + EnterpriseEntityHome home = +(EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome(); - try { - nextEntity = (EnterpriseEntity)home.findByPrimaryKey(beanName); - } catch
[JBoss-dev] CVS update: jbosstest/src/resources/lock/META-INF jboss.xml ejb-jar.xml
User: user57 Date: 01/07/10 22:52:09 Modified:src/resources/lock/META-INF ejb-jar.xml Added: src/resources/lock/META-INF jboss.xml Log: o updated lock test to excersise commit-option a, b (c & d but those are not enabled at the moment). o abstracted the actuall test outside of Worker, into Task so it is easier to add new lock tests o the test will also do a single bean, bean-to-bean Revision ChangesPath 1.2 +89 -31jbosstest/src/resources/lock/META-INF/ejb-jar.xml Index: ejb-jar.xml === RCS file: /cvsroot/jboss/jbosstest/src/resources/lock/META-INF/ejb-jar.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ejb-jar.xml 2000/10/09 18:12:29 1.1 +++ ejb-jar.xml 2001/07/11 05:52:09 1.2 @@ -1,37 +1,95 @@ - + - - -EnterpriseEntity -org.jboss.test.lock.interfaces.EnterpriseEntityHome -org.jboss.test.lock.interfaces.EnterpriseEntity -org.jboss.test.lock.bean.EnterpriseEntityBean -Container -java.lang.String -False - -name - - -field - - -nextEntity - -name - + + + EnterpriseEntity_A + org.jboss.test.lock.interfaces.EnterpriseEntityHome + org.jboss.test.lock.interfaces.EnterpriseEntity + org.jboss.test.lock.bean.EnterpriseEntityBean + Container + java.lang.String + False + name + field + nextEntity + name + + + + EnterpriseEntity_B + org.jboss.test.lock.interfaces.EnterpriseEntityHome + org.jboss.test.lock.interfaces.EnterpriseEntity + org.jboss.test.lock.bean.EnterpriseEntityBean + Container + java.lang.String + False + name + field + nextEntity + name + + + + EnterpriseEntity_C + org.jboss.test.lock.interfaces.EnterpriseEntityHome + org.jboss.test.lock.interfaces.EnterpriseEntity + org.jboss.test.lock.bean.EnterpriseEntityBean + Container + java.lang.String + False + name + field + nextEntity + name + + + + EnterpriseEntity_D + org.jboss.test.lock.interfaces.EnterpriseEntityHome + org.jboss.test.lock.interfaces.EnterpriseEntity + org.jboss.test.lock.bean.EnterpriseEntityBean + Container + java.lang.String + False + name + field + nextEntity + name + - + - - -EnterpriseEntity -* - -RequiresNew - - + + + EnterpriseEntity_A + * + + RequiresNew + + + + + EnterpriseEntity_B + * + + Required + - + + + EnterpriseEntity_C + * + + RequiresNew + + + + EnterpriseEntity_D + * + + RequiresNew + + + 1.1 jbosstest/src/resources/lock/META-INF/jboss.xml Index: jboss.xml === false EntityBean_A false org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker org.jboss.ejb.plugins.LogInterceptor org.jboss.ejb.plugins.SecurityInterceptor org.jboss.ejb.plugins.TxInterceptorCMT org.jboss.ejb.plugins.MetricsInterceptor org.jboss.ejb.plugins.EntityInstanceInterceptor org.jboss.ejb.plugins.EntitySynchronizationInterceptor org.jboss.ejb.plugins.EntityInstancePool org.jboss.ejb.plugins.EntityInstanceCache org.jboss.ejb.plugins.jaws.JAWSPersistenceManager org.jboss.tm.TxManager True org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy 50 1000 300 600 400 60 1 0.75 100 10 A EntityBean_B false org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker org.jboss.ejb.plugins.LogInterceptor org.jboss.ejb.plugins.SecurityInterceptor org.jboss.ejb.plugins.TxInterceptorCMT org.jboss.ejb.plugins.MetricsInterceptor org.jboss.ejb.plugins.EntityInstanceInterceptor or
[JBoss-dev] CVS update: jbosstest/src/main/org/jboss/test/lock/test EnterpriseEntityTest.java Main.java
User: user57 Date: 01/07/10 22:52:08 Modified:src/main/org/jboss/test/lock/test Main.java Added: src/main/org/jboss/test/lock/test EnterpriseEntityTest.java Log: o updated lock test to excersise commit-option a, b (c & d but those are not enabled at the moment). o abstracted the actuall test outside of Worker, into Task so it is easier to add new lock tests o the test will also do a single bean, bean-to-bean Revision ChangesPath 1.6 +38 -164 jbosstest/src/main/org/jboss/test/lock/test/Main.java Index: Main.java === RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/lock/test/Main.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Main.java 2001/07/10 02:34:04 1.5 +++ Main.java 2001/07/11 05:52:08 1.6 @@ -1,142 +1,18 @@ package org.jboss.test.lock.test; -import java.rmi.*; - -import java.util.HashMap; -import java.util.StringTokenizer; - -import javax.naming.Context; -import javax.naming.InitialContext; - -import javax.ejb.FinderException; - -import org.jboss.test.lock.interfaces.EnterpriseEntityHome; -import org.jboss.test.lock.interfaces.EnterpriseEntity; - import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.jboss.test.util.Deploy; -public class Main extends - TestCase +public class Main + extends TestCase { - - boolean deployed = false; - int nbThreads; - int iterations; - boolean b2b; - boolean nodeploy; - - HashMap param = new HashMap(); - EnterpriseEntity entity; - - public static void main(String arg[]) throws Exception { - Main main = new Main(arg); - main.testLock(); + public Main(String name) { + super(name); } - - public Main(String arg[]) { - super("main"); - // scanning parameters - int i = 0; - while (i < arg.length) { - StringTokenizer st = new StringTokenizer (arg[i++], "="); - param.put (st.nextToken (), st.hasMoreTokens () ? st.nextToken () : ""); - } - if (param.containsKey("help") || param.containsKey("-help")) { - System.out.println("Valid Parameters:"); - System.out.println(" threads= run threads concurrently (default 2)"); - System.out.println(" iterations= each thread will perform calls (default 10)"); - System.out.println(" b2b use bean to bean calls (default: single bean call)"); - System.out.println(); - System.exit(0); - } - } - -public Main(String name) -{ -super(name); -} - -protected void setUp() throws Exception -{ -init(); // get params -if( nodeploy == false ) -deploy(); // deploy the bean -} - -public void testLock() throws Exception -{ -Context ctx = new InitialContext(); -EnterpriseEntityHome home = (EnterpriseEntityHome)ctx.lookup("EnterpriseEntity"); - -try { -entity = home.findByPrimaryKey("seb"); -} catch (FinderException e) { -entity = home.create("seb"); -} - -if (b2b) entity.setNextEntity("daniel"); - -Worker[] threads = new Worker[nbThreads]; - -System.out.println("Spawning " + nbThreads + " threads for " + -iterations + " iterations" + -(b2b ? " with bean to bean call" : " with single bean call")); - -for (int i=0; ihttp://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] RE: [JBoss-user] Log4j configuration file location
> Central? I don't like this word. Pick a different one. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RE: [JBoss-user] log4j or JBoss logging
I would prefer using org.jboss as the root, such that category names can be generated from classnames. I am undescided about the best way to append other information to the category. Specifically, I want to specify a tag and instance id, but there does not seem to be a nice way to do this in Log4j. In a logging system that I have been working on and using for a while, a category might look something like this: some.package.SomeClass#sometag@837849 ^^ ^^^ ^^ category tag id The cat & id can be determined from any Object, and the tag can optionaly be assocated at Logger construction time. Unfortunatly with this scheme in Log4j (I belive), that for each instance, a new category will be created. Also it makes it harder to limit a given classes logging output, that can only be done on a per package basis. I thought that NDC might make a nice way to add tagging information, but to effectivly manage this wouldn't we have to NDC.push("blah"); try { // something } finally { NDC.pop(); } It also looks like there is other use of NDC currently not to mention that the method in which it is added to the output is not very plesant. Something that might work, would be to do something like this: some.package.SomeClass.SomeClass#sometag@837849 ^^^ ^^ category tag id This would add more categories and also make log output a bit more verbose with %c, but would still provide enough information with %c{1}. Loggers could then be created, by passing in a reference to 'this' or a class for non-instance logging as well as an optional tag. Tags could be gotten in a NDC fashion, so that instances do not need to pass aroung logger objects or tag names, but I am not sure how that would work out at the moment. My guess is that NDC will not be used in this fashion, and will continue to simply be an aide for debugging? Though I am not sure about that. NDC is very, very cool... I just have not gotten the hang of it just yet. --jason On Wed, 11 Jul 2001, Dain Sundstrom wrote: > I posted the original message to the wrong forum (user forum), and almost > lost the responses in all the traffic. > > I will switch over to direct log4j soon. > > Has anyone given any thought to how we should organize the log categories? > > For example, what root are we going to use 'jboss' or 'org.jboss'? > > I think we should follow class package name as close a possible, so cmp > messages would start at 'org.jboss.ejb.plugins.cmp'. > > My current plan is to use > 'org.jboss.ejb.plugins.cmp..' > > -dain > > > -Original Message- > > From: Scott M Stark [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, July 10, 2001 2:48 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [JBoss-user] log4j or JBoss logging > > > > > > Change to use log4j. The JBoss interface will disappear in 3.0 > > > > - Original Message - > > From: "Dain Sundstrom" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, July 10, 2001 12:08 PM > > Subject: [JBoss-user] log4j or JBoss logging > > > > > > > As I modify the JBossCMP code should I change the logging > > over to use > > log4j > > > directly or should I leave the code logging via the JBoss log layer? > > > > > > If I should switch to direct log4j, how do we categorize > > the logs? I was > > > thinking jboss.ejb.plugins.cmp.. > > or some thing > > > like that. This way I could turn off messages from beans > > and commands I'm > > > not testing. > > > > > > -dain > > > > > > ___ > > > JBoss-user mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > > > > ___ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] more contention fluff
Did you see the NullPointerException at all. I belive this will happen from time to time with option A or B. --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > I have a fix for this problem that I am stress testing now. Commit > option c is working fine with 20 threads and 10 iterations. > > - Original Message ----- > From: "Jason Dillon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 10, 2001 10:55 PM > Subject: [JBoss-dev] more contention fluff > > > > Well, I have not been able to track it down fully, but I modified the > > locktest to be a bit more agressive. First I simply up'd the thread and > > iteration count (which could cause a NullPointerException in the entity > > syncrhonization interceptor... but not all the time). It will also hang > > some times, and then sometimes it will just run fine. > > > > I was not sure if the commit-option had anything todo with it, so I > expanded > > the test to run over each commit option. With the thread count low (10 or > > so), option a and b work, but when it comes to c it never makes it > through, > > the test just hangs. I have no idea what happens with option d. > > > > All the while it produces a lot (alot of transactional contention on > > contextXXX) messages, which makes sence. > > > > I also changed the test to actually assert if the test failed. > > Unfortunatly, the test will timeout and not be included in the report... > not > > really sure why that is, but it is. > > > > *sigh* > > > > I was hoping to reproduce what I am seeing with this test, but it has not > > turned out that way. I can not even tune the test to fail each time... I > > really need a drink. It does fail though... with a hang or null pointer. > > > > Anyways, I commented out the c & d tests for now since they cause the > report > > not to show up and I turned the thread count down to 10 and iter to 20. > > Someone who knows a little more about the locking mechanism (marc?) might > > want to play with this test a little to see where it hangs and where the > > null is thrown. > > > > I ended up using the RMI IL for now, but I think that I still get a > > contention/hang after a while =( > > > > --jason > > > > > > ___ > > Jboss-development mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] RE: [JBoss-user] log4j or JBoss logging
What is the overhead of using highly dynamic category names? --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > I think we want to use the fully qualified classname. If the bean name is > added it should be appened to the classname. We need to be careful not > to introduce a lot of overhead in obtaining the logging category by > constructing highly dynamic category names. > > - Original Message - > From: "Dain Sundstrom" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 11, 2001 7:46 AM > Subject: [JBoss-dev] RE: [JBoss-user] log4j or JBoss logging > > > > I posted the original message to the wrong forum (user forum), and almost > > lost the responses in all the traffic. > > > > I will switch over to direct log4j soon. > > > > Has anyone given any thought to how we should organize the log categories? > > > > For example, what root are we going to use 'jboss' or 'org.jboss'? > > > > I think we should follow class package name as close a possible, so cmp > > messages would start at 'org.jboss.ejb.plugins.cmp'. > > > > My current plan is to use > > 'org.jboss.ejb.plugins.cmp..' > > > > -dain > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] jbosstest build failure
compile: [mkdir] Created dir: /nfs/home/jason/ws/jboss/jbosstest/build/classes [javac] Compiling 263 source files to /nfs/home/jason/ws/jboss/jbosstest/build/classes [javac] /nfs/home/jason/ws/jboss/jbosstest/src/main/org/jboss/test/perf/test/TestProbe.java:16: Class org.jboss.test.perf.interfaces.Entity2PK not found in import. [javac] import org.jboss.test.perf.interfaces.Entity2PK; [javac]^ [javac] /nfs/home/jason/ws/jboss/jbosstest/src/main/org/jboss/test/perf/test/TestProbe.java:18: Class org.jboss.test.perf.interfaces.Entity2Home not found in import. [javac] import org.jboss.test.perf.interfaces.Entity2Home; [javac]^ [javac] 2 errors --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] jboss daily test results
It also looks like the server failed to startup correctly, with a few: java.net.BindException: Address already in use --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > The test run includes less than half the current tests. Based on the run log > it looks > like the server ran out of threads during the lock test and the server > shutsdown > after than and all subsequent tests silently fail. What is the OS maker and > version here? > I see this is Sun's JDK 1.3.0 with a Linux 2.2.14 kernel, but from who? > > [EnterpriseEntity_B,ERROR] TRANSACTION ROLLBACK EXCEPTION:unable to create > new native thread; nested exception is: > java.lang.OutOfMemoryError: unable to create new native thread > [EnterpriseEntity_B,ERROR] java.lang.OutOfMemoryError: unable to create new > native thread > [EnterpriseEntity_B,ERROR] at java.lang.Thread.start(Native Method) > [EnterpriseEntity_B,ERROR] at > sun.rmi.transport.tcp.TCPChannel.free(TCPChannel.java:291) > [EnterpriseEntity_B,ERROR] at > sun.rmi.server.UnicastRef.free(UnicastRef.java:434) > [EnterpriseEntity_B,ERROR] at > sun.rmi.server.UnicastRef.done(UnicastRef.java:454) > [EnterpriseEntity_B,ERROR] at sun.rmi.transport.DGCImpl_Stub.dirty(Unknown > Source) > [EnterpriseEntity_B,ERROR] at > sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:323) > [EnterpriseEntity_B,ERROR] at > sun.rmi.transport.DGCClient$EndpointEntry.registerRefs(DGCClient.java:270) > [EnterpriseEntity_B,ERROR] at > sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:109) > [EnterpriseEntity_B,ERROR] at > sun.rmi.transport.LiveRef.read(LiveRef.java:267) > [EnterpriseEntity_B,ERROR] at > sun.rmi.server.UnicastRef2.readExternal(UnicastRef2.java:57) > [EnterpriseEntity_B,ERROR] at > java.rmi.server.RemoteObject.readObject(RemoteObject.java:203) > [EnterpriseEntity_B,ERROR] at java.lang.reflect.Method.invoke(Native > Method) > [EnterpriseEntity_B,ERROR] at > java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2213) > [EnterpriseEntity_B,ERROR] at > java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1410) > [EnterpriseEntity_B,ERROR] at > java.io.ObjectInputStream.readObject(ObjectInputStream.java:386) > [EnterpriseEntity_B,ERROR] at > java.io.ObjectInputStream.readObject(ObjectInputStream.java:236) > [EnterpriseEntity_B,ERROR] at > java.rmi.MarshalledObject.get(MarshalledObject.java:138) > [EnterpriseEntity_B,ERROR] at > org.jnp.interfaces.NamingContext.getServer(NamingContext.java:112) > [EnterpriseEntity_B,ERROR] at > org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:771) > [EnterpriseEntity_B,ERROR] at > org.jnp.interfaces.NamingContext.lookup(NamingContext.java:340) > [EnterpriseEntity_B,ERROR] at > org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333) > [EnterpriseEntity_B,ERROR] at > javax.naming.InitialContext.lookup(InitialContext.java:350) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jrmp.interfaces.AbstractHandle.lookupEJBHome(AbstractH > andle.java:111) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jrmp.interfaces.AbstractHandle.getEJBObject(AbstractHa > ndle.java:134) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jrmp.interfaces.EntityHandleImpl.getEJBObject(EntityHa > ndleImpl.java:67) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java > :467) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java > :514) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.loadOneEntity(JDBCLoad > EntityCommand.java:223) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadE > ntityCommand.java:180) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleRe > sult(JDBCQueryCommand.java:59) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:170 > ) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntity > Command.java:151) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistence > Manager.java:157) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager > .java:335) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchron > izationInterceptor.java:278) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterce > ptor.java:291) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor > .java:97) > [EnterpriseEntity_B,ERROR] at > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. > java:153) > [EnterpriseEntity_
[JBoss-dev] EntityInstanceInterceptor change
What was the problem... the diff is more or less the entire file. I am curious, because I am still running into a hang, though it seems like it might be MDB or SB related (not sure at the moment). --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > User: starksm > Date: 01/07/11 14:47:14 > > Modified:src/main/org/jboss/ejb/plugins > EntityInstanceInterceptor.java > Log: > Fix a thread starvation problem due to incomplete condition notification > Add support for trace level diagnositics > > Revision ChangesPath > 1.34 +408 -358 >jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java > > Index: EntityInstanceInterceptor.java > === > RCS file: >/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v > retrieving revision 1.33 > retrieving revision 1.34 > diff -u -r1.33 -r1.34 > --- EntityInstanceInterceptor.java 2001/07/10 22:45:41 1.33 > +++ EntityInstanceInterceptor.java 2001/07/11 21:47:14 1.34 > @@ -1,358 +1,408 @@ > -/* > - * JBoss, the OpenSource EJB server > - * > - * Distributable under LGPL license. > - * See terms of license at gnu.org. > - */ > -package org.jboss.ejb.plugins; > - > -import java.lang.reflect.Method; > -import java.rmi.RemoteException; > -import java.util.Map; > -import java.util.HashMap; > -import java.util.ArrayList; > - > -import javax.ejb.EJBObject; > -import javax.ejb.CreateException; > -import javax.ejb.EJBException; > -import javax.ejb.NoSuchEntityException; > -import javax.ejb.RemoveException; > -import javax.ejb.EntityBean; > -import javax.transaction.Status; > -import javax.transaction.Synchronization; > -import javax.transaction.Transaction; > -import javax.transaction.TransactionManager; > -import javax.transaction.RollbackException; > -import javax.transaction.SystemException; > - > -import org.jboss.ejb.Container; > -import org.jboss.ejb.EntityContainer; > -import org.jboss.ejb.EntityPersistenceManager; > -import org.jboss.ejb.EntityEnterpriseContext; > -import org.jboss.ejb.EnterpriseContext; > -import org.jboss.ejb.InstanceCache; > -import org.jboss.ejb.InstancePool; > -import org.jboss.ejb.MethodInvocation; > -import org.jboss.ejb.CacheKey; > -import org.jboss.metadata.EntityMetaData; > -import org.jboss.logging.Logger; > -import org.jboss.util.Sync; > - > -/** > - * The instance interceptors role is to acquire a context representing > - * the target object from the cache. > - * > - * This particular container interceptor implements pessimistic locking > - *on the transaction that is associated with the retrieved instance. If > - *there is a transaction associated with the target component and it is > - *different from the transaction associated with the MethodInvocation > - *coming in then the policy is to wait for transactional commit. > - * > - * We also implement serialization of calls in here (this is a spec > - *requirement). This is a fine grained notify, notifyAll mechanism. We > - *notify on ctx serialization locks and notifyAll on global transactional > - *locks. > - * > - * WARNING: critical code, get approval from senior developers > - *before changing. > - * > - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury > - * @version $Revision: 1.33 $ > - * > - * Revisions: > - * 2001/06/28: marcf > - * > - * Moved to new synchronization > - * Pools are gone simple design > - * two levels of syncrhonization with Tx and ctx > - * remove busy wait from previous mechanisms > - * > - */ > -public class EntityInstanceInterceptor > - extends AbstractInterceptor > -{ > - // Constants - > - > - // Attributes > - > - protected EntityContainer container; > - > - // Static > - > - // Constructors -- > - > - // Public > - > - public void setContainer(Container container) > - { > - this.container = (EntityContainer)container; > - } > - > - public Container getContainer() > - { > - return container; > - } > - > - // Interceptor implementation -- > - > - public Object invokeHome(MethodInvocation mi) > - throws Exception > - { > - // Get context > - EnterpriseContext ctx = >((EntityContainer)getContainer()).getInstancePool().get(); > - > - // Pass it to the method invocation > - mi.setEnterpriseContext(ctx); > - > - // Give it the transaction > - ctx.setTran
Re: [JBoss-dev] EntityInstanceInterceptor change
It is complicated. I have a client, which communicates with a servlet running on one JBoss server. That servlet then proxies one or more requests from the client to a stateless session bean running inside of another JBoss server. That bean creates 2 entities and the enqueues a messsage via the JMS RA to a queue that resides on yet another JBoss server. There is then a MDB running on the same machine as the first session bean, which reads the message, uses JMX to lookup an MBean to finish the processing. That MBean creates a stateful session bean and starts up a new thread. Inside that thread the session bean is called in a loop. Each call to the session bean causes some disk io, the creation of 2 more entity beans, updates to one of the first beans created (in the first paragraph) and finally another message gets queued via the JMS RA. There is another MDB running on another JBoss server which reads this message. It then creates or uses a pooled object to do some relavant processing. That object uses vanilla JMS to enqueue a response to the message when completed (or failed). In some cases where the invokation of this object failes, then the MDB will send the response (through the same mechanism). That response is read by yet another MDB running on the same machine as the first MDB, which creates or looks up a created statefull session bean to handle the response. That bean will then update the beans created for the request and a controlling bean (all entities). So, that is 5 virtual machines: o client o jms router o web server o request creation/response handler o worker Everything but the client is running in a JBoss server built from CVS. All JMS is done via the RMI IL, since I ran into too many problems with OIL and UIL. Durring all of this, the client will continue to poll, which will cause one of the first created entities to be reloaded to check the state of things. Now I understand that I could have all of this running in the same vm, but the nature of the application is to scale by adding hardware, so I need to test each logical component close to it's production usage. As a side note, all of the beans are marked with TIO = Required, which could be causing some problems, but should work regardless. The "dispatcher" has a connection to an Oracle 8 database via the JBossPool drivers (because I had too much problems with the Oracle versions a while ago). * * * So I updated my JBoss after you checked in the EEI change, but still ran into server hangs: Customer [Thread-13] WARN - Transaction XidImpl [FormatId=257, GlobalId=reason//160, BranchQual=] timed out. status=STATUS_COMMITING Customer [Thread-14] WARN - Transaction XidImpl [FormatId=257, GlobalId=reason//165, BranchQual=] timed out. status=STATUS_ACTIVE So I tired narrowing things down by not running the vm with the last MDB and things looked alot better. I also tried starting that VM but not having it respond, which worked... though to actually test all of this takes some time (to load up the required params and such). Any ways... it is complicated. All of this worked with 2.3 (though I was not using the JMS RA). As a side note, it only seems to break when I try to put it under a high message volume (by high I mean 50 or so... from the first first statfull session bean to the second MDB). *sigh* --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > Generate a thread dump using SIGHUP or Ctrl-\ on unix/linux or Ctrl-Break on > win32. > This should be the first step to any deadlock/starvation investigation. The > sun vm > tends to produce garbage dumps with HotSpot so turn it off using > the -classic > switch. > > MDBs are involed in the lock unit test so what are you running? > > ----- Original Message - > From: "Jason Dillon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 11, 2001 8:57 PM > Subject: [JBoss-dev] EntityInstanceInterceptor change > > > > What was the problem... the diff is more or less the entire file. I am > > curious, because I am still running into a hang, though it seems like it > > might be MDB or SB related (not sure at the moment). > > > > --jason > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] jboss daily test results
Could we have the detail of each test html'ifyed. I would do it, but I don't know much about xml stylesheets. Mozilla just strips out all of the tags, which makes it a bit hard to look at. --jason On Thu, 12 Jul 2001, Chris Kimpton wrote: > Hi, > > > > I am re-running them to see if it works now. > > > > All clean now... > > > SUMMARY > > > > Number of tests run: 132 > > > > > > > > Successful tests: 132 > > > > Errors:0 > > > > Failures: 0 > > > > > > > > [time of test: 12 July 2001 13:13 GMT] > > > wierd... > > Chris > > = > Need somewhere to Live in London - http://freeflats.com > > __ > Do You Yahoo!? > Get personalized email addresses from Yahoo! Mail > http://personal.mail.yahoo.com/ > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] CVS update: jboss/src/resources/org/jboss/metadatajaws_2_4.dtd
I thought CVS did crlf translations... did we break it somehow? --jason On Thu, 12 Jul 2001, Scott M Stark wrote: > User: starksm > Date: 01/07/12 10:39:47 > > Modified:src/resources/org/jboss/metadata jaws_2_4.dtd > Log: > Remove the damn dos carriage returns > > Revision ChangesPath > 1.5 +73 -73jboss/src/resources/org/jboss/metadata/jaws_2_4.dtd > > Index: jaws_2_4.dtd > === > RCS file: /cvsroot/jboss/jboss/src/resources/org/jboss/metadata/jaws_2_4.dtd,v > retrieving revision 1.4 > retrieving revision 1.5 > diff -u -r1.4 -r1.5 > --- jaws_2_4.dtd2001/07/12 17:38:26 1.4 > +++ jaws_2_4.dtd2001/07/12 17:39:47 1.5 > @@ -1,17 +1,17 @@ > - > - > + > + > > +--> > > -enterprise-beans? , type-mappings?)> > - > + from standardjaws.xml --> > +enterprise-beans? , type-mappings?)> > + > > - > - > + --> > + > + > > - > - > - > - > -, pk-constraint? , select-for-update? , time-out)> > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + element that carries a separate meaning: This DTD wil not parse! --> > + > + > + > + > +, pk-constraint? , select-for-update? , time-out)> > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > - > - > + CMP bean in this ejb-jar that requires non-default column mapping behavior --> > + > + > > -read-only? , table-name? , tuned-updates? , create-table? , remove-table? , >select-for-update? , time-out? , pk-constraint?)> > - > +--> > +read-only? , table-name? , tuned-updates? , create-table? , remove-table? , >select-for-update? , time-out? , pk-constraint?)> > + > > - > - > - > - > - > - > - > - > + in ejb-jar.xml. --> > + > + > + > + > + > + > + > + > > - > - > + option!--> > + > + > > - > - > + method from the bean's home interface --> > + > + > > - > - > + inner join clause, it may specify multiple tables. --> > + > + > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + query for the finder --> > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Info.java InfoMBean.java
User: user57 Date: 01/07/12 14:13:07 Modified:src/main/org/jboss/util Info.java InfoMBean.java Log: o added methods to enable/disable vm method and instruction tracing if the target vm can do that. Should probably be moved to a Debug mbean or something, but for now Info will work. Revision ChangesPath 1.13 +16 -1 jboss/src/main/org/jboss/util/Info.java Index: Info.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Info.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Info.java 2001/07/09 22:58:59 1.12 +++ Info.java 2001/07/12 21:13:07 1.13 @@ -20,7 +20,8 @@ * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. * @author mailto:[EMAIL PROTECTED]";>Scott Stark. * @author mailto:[EMAIL PROTECTED]";>Hiram Chirino. - * @version $Revision: 1.12 $ + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.13 $ */ public class Info implements InfoMBean, MBeanRegistration @@ -178,5 +179,19 @@ "Total Thread Groups: "+activeGroups+""+ getThreadGroupInfo(root) ; return rc; + } + + /** +* Enable or disable tracing method calls at the Runtime level. +*/ + public void traceMethodCalls(final boolean flag) { + Runtime.getRuntime().traceMethodCalls(flag); + } + + /** +* Enable or disable tracing instructions the Runtime level. +*/ + public void traceInstructions(final boolean flag) { + Runtime.getRuntime().traceInstructions(flag); } } 1.6 +4 -1 jboss/src/main/org/jboss/util/InfoMBean.java Index: InfoMBean.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/InfoMBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- InfoMBean.java2001/07/09 22:55:06 1.5 +++ InfoMBean.java2001/07/12 21:13:07 1.6 @@ -13,7 +13,8 @@ * * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. * @author mailto:[EMAIL PROTECTED]";>Hiram Chirino. - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.6 $ */ public interface InfoMBean { @@ -21,4 +22,6 @@ String listSystemInfo(); String listThreadDump(); String runGarbageCollector(); + void traceMethodCalls(boolean flag); + void traceInstructions(boolean flag); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] Log4j xml config and custom priorities
I just learned this (from reading the log4j dtd) can be configured via: The current version that JBoss is using still does not support setting the CategoryFactory, but the CVS version of Log4j does have that in it's DTD. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Log4j xml config and custom priorities
Or not =( --jason On Thu, 12 Jul 2001, Jason Dillon wrote: > I just learned this (from reading the log4j dtd) can be configured via: > > >class="org.jboss.logging.log4j.TracePriority"/> > > > The current version that JBoss is using still does not support setting the > CategoryFactory, but the CVS version of Log4j does have that in it's DTD. > > --jason > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins StatelessSessionInstanceInterceptor.java
User: user57 Date: 01/07/12 16:53:02 Modified:src/main/org/jboss/ejb/plugins StatelessSessionInstanceInterceptor.java Log: o re-indent & removal of unused imports. Revision ChangesPath 1.8 +28 -50 jboss/src/main/org/jboss/ejb/plugins/StatelessSessionInstanceInterceptor.java Index: StatelessSessionInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatelessSessionInstanceInterceptor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- StatelessSessionInstanceInterceptor.java 2001/06/18 20:01:23 1.7 +++ StatelessSessionInstanceInterceptor.java 2001/07/12 23:53:02 1.8 @@ -6,40 +6,19 @@ */ package org.jboss.ejb.plugins; -import java.lang.reflect.Method; import java.rmi.RemoteException; -import java.util.Map; -import java.util.HashMap; -import java.util.ArrayList; - -import javax.ejb.EJBObject; -import javax.ejb.CreateException; -import javax.ejb.EJBException; -import javax.ejb.NoSuchEntityException; -import javax.ejb.RemoveException; -import javax.ejb.EntityBean; -import javax.transaction.Status; -import javax.transaction.Synchronization; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; -import javax.transaction.RollbackException; -import javax.transaction.SystemException; import org.jboss.ejb.Container; -import org.jboss.ejb.StatelessSessionContainer; -import org.jboss.ejb.EnterpriseContext; -import org.jboss.ejb.InstanceCache; -import org.jboss.ejb.InstancePool; import org.jboss.ejb.MethodInvocation; +import org.jboss.ejb.StatelessSessionContainer; /** - * This container acquires the given instance. This must be used after - * the EnvironmentInterceptor, since acquiring instances requires a proper - * JNDI environment to be set + * This container acquires the given instance. This must be used after + * the EnvironmentInterceptor, since acquiring instances requires a proper + * JNDI environment to be set * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.7 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.8 $ */ public class StatelessSessionInstanceInterceptor extends AbstractInterceptor @@ -47,39 +26,40 @@ // Constants - // Attributes - protected StatelessSessionContainer container; + + protected StatelessSessionContainer container; // Static // Constructors -- // Public - public void setContainer(Container container) + + public void setContainer(final Container container) { - this.container = (StatelessSessionContainer)container; + this.container = (StatelessSessionContainer)container; } - public Container getContainer() + public Container getContainer() { - return container; + return container; } // Interceptor implementation -- - public Object invokeHome(MethodInvocation mi) - throws Exception + + public Object invokeHome(final MethodInvocation mi) throws Exception { - // We don't need an instance since the call will be handled by container + // We don't need an instance since the call will be handled by container return getNext().invokeHome(mi); } - public Object invoke(MethodInvocation mi) - throws Exception + public Object invoke(final MethodInvocation mi) throws Exception { // Get context mi.setEnterpriseContext(container.getInstancePool().get()); - // There is no need for synchronization since the instance is always fresh also there should - // never be a tx associated with the instance. + // There is no need for synchronization since the instance is always fresh also there should + // never be a tx associated with the instance. try { @@ -87,23 +67,21 @@ return getNext().invoke(mi); } catch (RuntimeException e) // Instance will be GC'ed at MI return { - mi.setEnterpriseContext(null); - throw e; + mi.setEnterpriseContext(null); + throw e; } catch (RemoteException e) // Instance will be GC'ed at MI return { - mi.setEnterpriseContext(null); - throw e; + mi.setEnterpriseContext(null); + throw e;
Re: [JBoss-dev] EntityInstanceInterceptor change
Just a note, I started running everything with -classic and now I do not even get passed the first request creation. =( --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > Alright. Like I said the best starting point is a thread dump of the VM that > appears to be hanging. Post it if you get one that looks interesting. > > - Original Message ----- > From: "Jason Dillon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 11, 2001 10:47 PM > Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > > > > It is complicated. > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerPlugin.java
User: user57 Date: 01/07/12 17:19:46 Modified:src/main/org/jboss/ejb ContainerPlugin.java Log: o re-indent & removal of public keyword Revision ChangesPath 1.6 +12 -12jboss/src/main/org/jboss/ejb/ContainerPlugin.java Index: ContainerPlugin.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerPlugin.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ContainerPlugin.java 2001/06/18 20:01:21 1.5 +++ ContainerPlugin.java 2001/07/13 00:19:46 1.6 @@ -9,21 +9,21 @@ import org.jboss.util.Service; /** - * This is a superinterface for all Container plugins. All plugin interfaces - * must extend this interface. + * This is a superinterface for all Container plugins. + * + * All plugin interfaces must extend this interface. * - * @see Service - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.5 $ + * @see Service + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.6 $ */ public interface ContainerPlugin extends Service { - // Public - /** - * This callback is set by the container so that the plugin may access it - * - * @param con the container using this plugin - */ - public void setContainer(Container con); + /** +* This callback is set by the container so that the plugin may access it +* +* @param conThe container using this plugin. +*/ + void setContainer(Container con); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Service.java
User: user57 Date: 01/07/12 17:34:59 Modified:src/main/org/jboss/util Service.java Log: o javadoc'd Revision ChangesPath 1.4 +25 -12jboss/src/main/org/jboss/util/Service.java Index: Service.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Service.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Service.java 2001/06/18 20:01:28 1.3 +++ Service.java 2001/07/13 00:34:59 1.4 @@ -7,21 +7,34 @@ package org.jboss.util; /** - * + * Defines a model for a service. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. - * @version $Revision: 1.3 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. + * @version $Revision: 1.4 $ */ public interface Service { - public void init() - throws Exception; - - public void start() - throws Exception; + /** +* Initalize the service. +* +* @throws ExceptionService failed to initalize. +*/ + void init() throws Exception; + + /** +* Start the service. +* +* @throws ExceptionService failed to start. +*/ + void start() throws Exception; + + /** +* Stop the service. +*/ + void stop(); - public void stop(); - - public void destroy(); + /** +* Destroy the service. +*/ + void destroy(); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerInvoker.java
User: user57 Date: 01/07/12 17:36:33 Modified:src/main/org/jboss/ejb ContainerInvoker.java Log: o re-indented & cleaned up javadoc Revision ChangesPath 1.8 +75 -78jboss/src/main/org/jboss/ejb/ContainerInvoker.java Index: ContainerInvoker.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerInvoker.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- ContainerInvoker.java 2001/06/18 20:01:21 1.7 +++ ContainerInvoker.java 2001/07/13 00:36:33 1.8 @@ -12,92 +12,89 @@ import javax.ejb.EJBMetaData; import javax.ejb.EJBHome; import javax.ejb.EJBObject; -import javax.naming.Name; /** - * This is an interface for Container plugins. Implementations of this - * interface are responsible for receiving remote invocations of EJB's - * and to forward these requests to the Container it is being used with. + * This is an interface for Container plugins. Implementations of this + * interface are responsible for receiving remote invocations of EJB's + * and to forward these requests to the Container it is being used with. * - * It is responsible for providing any EJBObject and EJBHome implementations - * (which may be statically or dynamically created). + * It is responsible for providing any EJBObject and EJBHome + *implementations (which may be statically or dynamically created). * - * Before forwarding a call to the container it must call Thread.setContextClassLoader() - * with the classloader of the container. It must also handle any propagated transaction - * and security contexts properly. It may acquire the TransactionManager from JNDI. + * Before forwarding a call to the container it must call + *Thread.setContextClassLoader() with the classloader of the container. + *It must also handle any propagated transaction and security contexts + *properly. It may acquire the TransactionManager from JNDI. * - * @see Container - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury - * @version $Revision: 1.7 $ + * @see Container + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.8 $ */ public interface ContainerInvoker extends ContainerPlugin { - // Public - - /** - * This method is called whenever the metadata for this container is - * needed. - * - * @return an implementation of the EJBMetaData interface - */ - public EJBMetaData getEJBMetaData(); - - - /** - * This method is called whenever the EJBHome implementation for this - * container is needed. - * - * @return an implementation of the home interface for this container - */ - public EJBHome getEJBHome(); - - - /** - * This method is called whenever an EJBObject implementation for a stateless - * session bean is needed. - * - * @return an implementation of the remote interface for this container - * @exception RemoteException thrown if the EJBObject could not be created - */ - public EJBObject getStatelessSessionEJBObject() - throws RemoteException; - - - /** - * This method is called whenever an EJBObject implementation for a stateful - * session bean is needed. - * - * @param id the id of the session - * @return an implementation of the remote interface for this container - * @exception RemoteException thrown if the EJBObject could not be created - */ - public EJBObject getStatefulSessionEJBObject(Object id) - throws RemoteException; - - - /** - * This method is called whenever an EJBObject implementation for an entitybean - * is needed. - * - * @param id the primary key of the entity - * @return an implementation of the remote interface for this container - * @exception RemoteException thrown if the EJBObject could not be created - */ - public EJBObject getEntityEJBObject(Object id) - throws RemoteException; - - - /** - * This method is called whenever a collection of EJBObjects for a collection of primary keys - * is needed. - * - * @param enum enumeration of primary keys - * @return a collection of EJBObjects implementing the remote interface for this container - * @exception RemoteException thrown if the EJBObjects could not be created - */ - public Collection getEntityCollection(Collection
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb InstancePoolContainer.java
User: user57 Date: 01/07/12 17:39:13 Modified:src/main/org/jboss/ejb InstancePoolContainer.java Log: o re-indent & javadoc'd Revision ChangesPath 1.4 +13 -15jboss/src/main/org/jboss/ejb/InstancePoolContainer.java Index: InstancePoolContainer.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/InstancePoolContainer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- InstancePoolContainer.java2001/06/18 20:01:21 1.3 +++ InstancePoolContainer.java2001/07/13 00:39:13 1.4 @@ -6,26 +6,24 @@ */ package org.jboss.ejb; -import java.rmi.RemoteException; -import java.util.Collection; - -import javax.ejb.EJBMetaData; -import javax.ejb.EJBHome; -import javax.ejb.EJBObject; -import javax.naming.Name; - /** - * This is an interface for Containers that uses InstancePools. + * This is an interface for Containers that uses InstancePools. * - * Plugins wanting to access pools from containers should use this interface + * Plugins wanting to access pools from containers should use this + *interface. * - * @see InstancePool - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.3 $ + * @see InstancePool + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.4 $ */ public interface InstancePoolContainer { - // Public - public InstancePool getInstancePool(); + /** +* Get the instance pool for the container. +* +* @return The instance pool for the container. +*/ + InstancePool getInstancePool(); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb InstancePool.java
User: user57 Date: 01/07/12 17:36:58 Modified:src/main/org/jboss/ejb InstancePool.java Log: o re-indent & cleaned up javadoc Revision ChangesPath 1.5 +18 -27jboss/src/main/org/jboss/ejb/InstancePool.java Index: InstancePool.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/InstancePool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InstancePool.java 2001/06/18 20:01:21 1.4 +++ InstancePool.java 2001/07/13 00:36:58 1.5 @@ -9,48 +9,39 @@ import java.rmi.RemoteException; /** - * + * Defines the model for a EnterpriseContext instance pool. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.4 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.5 $ */ public interface InstancePool extends ContainerPlugin { - // Constants - - - // Attributes - - // Static - - // Constructors -- - - // Public /** -* Get an instance without identity. -* Can be used by finders and create-methods, or stateless beans +* Get an instance without identity. +* +* Can be used by finders and create-methods, or stateless beans * -* @return Context /w instance -* @exception RemoteException +* @returnContext/w instance +* +* @throws ExceptionRemoteException */ - public EnterpriseContext get() - throws Exception; + EnterpriseContext get() throws Exception; /** -* Return an anonymous instance after invocation. +* Return an anonymous instance after invocation. * -* @param ctx +* @param ctxThe context to free. */ - public void free(EnterpriseContext ctx); + void free(EnterpriseContext ctx); /** -* Discard an anonymous instance after invocation. -* This is called if the instance should not be reused, perhaps due to some -* exception being thrown from it. +* Discard an anonymous instance after invocation. +* This is called if the instance should not be reused, perhaps due to some +* exception being thrown from it. * -* @param ctx +* @param ctxThe context to discard. */ - public void discard(EnterpriseContext ctx); + void discard(EnterpriseContext ctx); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb AutoDeployerMBean.java
User: user57 Date: 01/07/12 17:42:49 Modified:src/main/org/jboss/ejb AutoDeployerMBean.java Log: o javadoc'd Revision ChangesPath 1.6 +38 -15jboss/src/main/org/jboss/ejb/AutoDeployerMBean.java Index: AutoDeployerMBean.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/AutoDeployerMBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AutoDeployerMBean.java2001/06/18 20:01:21 1.5 +++ AutoDeployerMBean.java2001/07/13 00:42:49 1.6 @@ -9,24 +9,47 @@ import org.jboss.util.ServiceMBean; /** - * This is the interface of the AutoDeployer that is exposed for - * administration + * This is the interface of the AutoDeployer that is exposed for + * administration * - * @see AutoDeployer - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp - * @version $Revision: 1.5 $ + * @see AutoDeployer + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Toby Allsopp + * @version $Revision: 1.6 $ */ public interface AutoDeployerMBean - extends ServiceMBean + extends ServiceMBean { - // Constants - - public static final String OBJECT_NAME = "EJB:service=AutoDeployer"; - - // Public - public void setURLs(String urlList); - public String getURLs(); - public void setDeployers(String deployers); - public String getDeployers(); + /** The default object name. */ + String OBJECT_NAME = "EJB:service=AutoDeployer"; + + /** +* Set the list of urls to watch. +* +* @param urlListThe list of urls to watch. +*/ + void setURLs(String urlList); + + /** +* Get the list of urls that are currently being watched. +* +* @return The list of urls that are currently being watched. +*/ + String getURLs(); + + /** +* Set the list of deployers that will be used. +* +* @param deployersThe list of deployers that will be used. +*/ + void setDeployers(String deployers); + + /** +* Get the list of deployers that is currently being used. +* +* @return The list of deployers that is currently being used. +*/ + String getDeployers(); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb InstanceCache.java
User: user57 Date: 01/07/12 17:36:07 Modified:src/main/org/jboss/ejb InstanceCache.java Log: o re-indent, cleaned up javadoc Revision ChangesPath 1.8 +56 -47jboss/src/main/org/jboss/ejb/InstanceCache.java Index: InstanceCache.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/InstanceCache.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- InstanceCache.java2001/06/18 20:01:21 1.7 +++ InstanceCache.java2001/07/13 00:36:07 1.8 @@ -10,67 +10,76 @@ import java.rmi.NoSuchObjectException; /** - * The plugin that gives a container a cache for bean instances. + * The plugin that gives a container a cache for bean instances. * - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Simone Bordet - * @version $Revision: 1.7 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Simone Bordet + * @version $Revision: 1.8 $ */ public interface InstanceCache extends ContainerPlugin { /** - * Gets a bean instance from this cache given the identity. - * This method may involve activation if the instance is not in the cache. - * Implementation should have O(1) complexity. - * This method is never called for stateless session beans. - * - * @param id the primary key of the bean - * @return the EnterpriseContext related to the given id - * @exception RemoteException in case of illegal calls (concurrent / reentrant), - * NoSuchObjectException if the bean cannot be found. - * @see #release - */ - public EnterpriseContext get(Object id) - throws RemoteException, NoSuchObjectException; +* Gets a bean instance from this cache given the identity. This method +* may involve activation if the instance is not in the cache. +* +* Implementation should have O(1) complexity. +* +* This method is never called for stateless session beans. +* +* @param idThe primary key of the bean . +* @return The EnterpriseContext related to the given id. +* +* @throws RemoteException In case of illegal calls (concurrent / +* reentrant) +* @throws NoSuchObjectExceptionif the bean cannot be found. +* +* @see #release +*/ + EnterpriseContext get(Object id) + throws RemoteException, NoSuchObjectException; /** - * Inserts an active bean instance after creation or activation. - * Implementation should guarantee proper locking and O(1) complexity. - * - * @param ctx the EnterpriseContext to insert in the cache - * @see #remove - */ - public void insert(EnterpriseContext ctx); +* Inserts an active bean instance after creation or activation. +* +* Implementation should guarantee proper locking and O(1) complexity. +* +* @param ctxThe EnterpriseContext to insert in the cache +* +* @see #remove +*/ + void insert(EnterpriseContext ctx); /** - * Releases the given bean instance from this cache. - * This method may passivate the bean to get it out of the cache. - * Implementation should return almost immediately leaving the - * passivation to be executed by another thread. - * - * @param ctx the EnterpriseContext to release - * @see #get - */ - public void release(EnterpriseContext ctx); +* Releases the given bean instance from this cache. +* This method may passivate the bean to get it out of the cache. +* Implementation should return almost immediately leaving the +* passivation to be executed by another thread. +* +* @param ctxThe EnterpriseContext to release +* +* @see #get +*/ + void release(EnterpriseContext ctx); /** - * Removes a bean instance from this cache given the identity. - * Implementation should have O(1) complexity and guarantee proper locking. - * - * @param id the pimary key of the bean - * @see #insert - */ - public void remove(Object id); +* Removes a bean instance from this cache given the identity. +* Implementation should have O(1) complexity and guarantee proper locking. +* +* @param idThe pimary key of the bean. +* +* @see #insert +*/ + void remove(Object id); /** - * Checks whether an instance corresponding to a particular id is active - * - * @param id the pimary key of the bean - * @see #insert - */ - public boolean isActive(Object id); - +* Checks whether an instance corresponding to a particular
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb CacheKey.java
User: user57 Date: 01/07/12 17:45:26 Modified:src/main/org/jboss/ejb CacheKey.java Log: o re-indent Revision ChangesPath 1.15 +113 -113 jboss/src/main/org/jboss/ejb/CacheKey.java Index: CacheKey.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/CacheKey.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- CacheKey.java 2001/07/10 04:42:58 1.14 +++ CacheKey.java 2001/07/13 00:45:26 1.15 @@ -7,6 +7,10 @@ package org.jboss.ejb; import java.io.Externalizable; +import java.io.ObjectOutput; +import java.io.ObjectInput; +import java.io.IOException; + import java.rmi.MarshalledObject; import org.apache.log4j.Category; @@ -25,134 +29,130 @@ * * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author Bill Burke - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ */ public class CacheKey -implements Externalizable + implements Externalizable { -// Constants - + // Constants - -// Attributes + // Attributes -/** - * The database primaryKey. - * - * This primaryKey is used by: - * - * org.jboss.ejb.plugins.EntityInstanceCache.setKey() - to set the EntityEnterpriseContext id - * org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(): - * - implementing Entity.toString() --> cacheKey.getId().toString() - * - implementing Entity.hashCode() --> cacheKey.getId().hashCode() - * - etc... - * org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.EntityProxy.getId() - */ -protected Object id; + /** +* The database primaryKey. +* +* This primaryKey is used by: +* +* org.jboss.ejb.plugins.EntityInstanceCache.setKey() - to set the EntityEnterpriseContext id +* org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(): +* - implementing Entity.toString() --> cacheKey.getId().toString() +* - implementing Entity.hashCode() --> cacheKey.getId().hashCode() +* - etc... +* org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.EntityProxy.getId() +*/ + protected Object id; -public Object getId() -{ - return id; -} + public Object getId() + { + return id; + } -/** The Marshalled Object representing the key */ -protected MarshalledObject mo; + /** The Marshalled Object representing the key */ + protected MarshalledObject mo; -/** The Marshalled Object's hashcode */ -protected int hashCode; + /** The Marshalled Object's hashcode */ + protected int hashCode; -// Static + // Static -// Public + // Public -public CacheKey() { - // For externalization only -} + public CacheKey() { + // For externalization only + } -public CacheKey(Object id) { -// why does this throw an error and not an IllegalArgumentException ? - if (id == null) throw new Error("id may not be null"); + public CacheKey(Object id) { + // why does this throw an error and not an IllegalArgumentException ? + if (id == null) throw new Error("id may not be null"); - this.id = null; + this.id = null; - try { - // Equals rely on the MarshalledObject itself - mo = new MarshalledObject(id); - // Make a copy of the id to enforce copy semantics and - // allow reuse of the original primary key - this.id = mo.get(); - // Precompute the hashCode (speed) - hashCode = mo.hashCode(); - } - catch (Exception e) { - // - // should probably throw a nested exception here, but - // for now instead of printStackTrace, lets log it - // - Category log = Category.getInstance(this.getClass()); - log.error("failed to initialize", e); -} -} - -// Z implementation -- - -// Package protected - - -// Protected - - -// Private --- - -public void write
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb ContainerFactoryMBean.java
User: user57 Date: 01/07/12 18:00:20 Modified:src/main/org/jboss/ejb ContainerFactoryMBean.java Log: o re-ident & cleaned up javadoc Revision ChangesPath 1.14 +82 -71jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java Index: ContainerFactoryMBean.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ContainerFactoryMBean.java2001/06/18 20:01:21 1.13 +++ ContainerFactoryMBean.java2001/07/13 01:00:19 1.14 @@ -6,132 +6,143 @@ */ package org.jboss.ejb; +import java.util.Iterator; import java.net.MalformedURLException; +import org.jboss.util.ServiceMBean; + /** - * This is the interface of the ContainerFactory that is exposed for administration - * - * @see ContainerFactory - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors + * This is the interface of the ContainerFactory that is exposed + * for administration. * - * @version $Revision: 1.13 $ + * @see ContainerFactory + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Juha Lindfors + * @version $Revision: 1.14 $ */ public interface ContainerFactoryMBean - extends org.jboss.util.ServiceMBean + extends ServiceMBean { - // Constants - - public static String OBJECT_NAME = ":service=ContainerFactory"; - - // Public + /** The default object name. */ + String OBJECT_NAME = ":service=ContainerFactory"; /** * Returns the applications deployed by the container factory */ - public java.util.Iterator getDeployedApplications(); + Iterator getDeployedApplications(); + /** - * Deploy an application - * - * @param url URL to the directory with the given EJBs to be deployed -* @param appId Id of the application this EJBs belongs to -*used for management - * @exception MalformedURLException - * @exception DeploymentException - */ - public void deploy(String url, String appId ) +* Deploy an application +* +* @param url URL to the directory with the given EJBs to be deployed +* @param appIdId of the application this EJBs belongs to +* used for management +* +* @throws MalformedURLException +* @throws DeploymentException +*/ + void deploy(String url, String appId ) throws MalformedURLException, DeploymentException; /** - * Deploy an application - * -* @param appUrl Url to the application itself -* @param jarUrls Array of URLs to the JAR files containing the EJBs -* @param appId Id of the application this EJBs belongs to -*used for management - * @exception MalformedURLException - * @exception DeploymentException - */ - public void deploy( String appUurl, String[] jarUrls, String appId ) +* Deploy an application +* +* @param appUrl Url to the application itself +* @param jarUrlsArray of URLs to the JAR files containing the EJBs +* @param appId Id of the application this EJBs belongs to +* used for management +* +* @throws MalformedURLException +* @throws DeploymentException +*/ + void deploy( String appUurl, String[] jarUrls, String appId ) throws MalformedURLException, DeploymentException; - /** - * Undeploy an application - * - * @param url - * @exception MalformedURLException - * @exception DeploymentException - */ - public void undeploy(String url) + /** +* Undeploy an application +* +* @param url +* +* @throws MalformedURLException +* @throws DeploymentException +*/ + void undeploy(String url) throws MalformedURLException, DeploymentException; /** * Enable/disable bean verification upon deployment. * -* @paramverify true to enable the verifier; false to disable +* @param verifytrue to enable the verifier; false to disable */ - public void setVerifyDeployments(boolean verify); + void setVerifyDeployments(boolean verify); /** * Returns the state of the verifier (enabled/disabled) * * @return true if verifier is enabled; false otherwise */ - public boolean getVerifyDeployments(); + boolean getVerifyDeployments();
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util Shutdown.java ShutdownMBean.java
User: user57 Date: 01/07/12 18:22:26 Modified:src/main/org/jboss/util Shutdown.java ShutdownMBean.java Log: o added support to invoke Runtime.halt() o added a tad bit more logging Revision ChangesPath 1.6 +59 -18jboss/src/main/org/jboss/util/Shutdown.java Index: Shutdown.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/Shutdown.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Shutdown.java 2001/06/22 23:11:15 1.5 +++ Shutdown.java 2001/07/13 01:22:26 1.6 @@ -6,62 +6,94 @@ */ package org.jboss.util; -import java.io.*; -import java.net.*; -import java.util.*; +import java.util.List; +import java.util.ArrayList; -import org.apache.log4j.Category; +import javax.management.MBeanRegistration; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.ObjectName; -import javax.management.*; +import org.apache.log4j.Category; /** * Shutdown service. Installs a hook to cleanly shutdown the server and * provides the ability to handle user shutdown requests. * - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.6 $ */ public class Shutdown implements MBeanRegistration, ShutdownMBean { // Constants - + /** The default object name to use. */ public static final String OBJECT_NAME = ":type=Shutdown"; // Attributes /** Instance logger. */ private final Category log = Category.getInstance(Shutdown.class); - - List mbeans = new ArrayList(); - MBeanServer server; + + /** The MBean server we are attached to. */ + private MBeanServer server; // Public --- + + /** +* Shutdown the virtual machine and run shutdown hooks. +*/ public void shutdown() { + log.info("Shutting down"); System.exit(0); // This will execute the shutdown hook } + + /** +* Forcibly terminates the currently running Java virtual machine. +*/ + public void halt() + { + System.err.println("Halting the system now!"); + Runtime.getRuntime().halt(0); + } // MBeanRegistration implementation -- - public ObjectName preRegister(final MBeanServer server, ObjectName name) + /** +* Saves a reference to the MBean server for later use and installs +* a shutdown hook. +* +* @param serverThe MBean server which we are going to be registered. +* @param name The object name we have been configured to use. +* @return Our preferred object name. +* +* @throws MalformedObjectNameException +*/ + public ObjectName preRegister(final MBeanServer server, + final ObjectName name) throws Exception { this.server = server; try { - Runtime.getRuntime().addShutdownHook(new Thread() + Runtime.getRuntime().addShutdownHook(new Thread("JBoss Shutdown Hook") { public void run() { + log.info("Shutting down all services"); System.out.println("Shutting down"); // Make sure all services are down properly shutdownServices(); - + + log.info("Shutdown complete"); System.out.println("Shutdown complete"); } }); + log.info("Shutdown hook added"); } catch (Throwable e) { @@ -72,23 +104,31 @@ public void postRegister(Boolean registrationDone) { + // empty } - public void preDeregister() - throws Exception + public void preDeregister() throws Exception { + // empty } public void postDeregister() { + // empty } - + + /** +* Attempt to stop and destroy all services +* running inside of the MBean server which we are attached too by +* asking the ServiceControl to do the dirty work. +*/ protected void shutdownServices() { try { // Stop services - server.invoke(new ObjectName(":service=Servi
[JBoss-dev] CVS update: jboss/src/main/org/jboss Shutdown.java
User: user57 Date: 01/07/12 18:22:58 Modified:src/main/org/jboss Shutdown.java Log: o re-indented & using different URL contructor Revision ChangesPath 1.2 +55 -41jboss/src/main/org/jboss/Shutdown.java Index: Shutdown.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/Shutdown.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Shutdown.java 2001/03/27 16:32:39 1.1 +++ Shutdown.java 2001/07/13 01:22:58 1.2 @@ -7,50 +7,64 @@ package org.jboss; -import java.io.*; -import java.net.*; -import java.util.*; +import java.net.URL; /** - * Provides an OS-independent way of shutting down JBoss. This - * works by accessing the JMX server and giving it the shutdown - * command. The host to the JMX server can be passed in as well - * as the port number. If neither is supplied, the defaults of - * localhost and 8082 are used. - * - * - * Usage: java org.jboss.Shutdown [host] [port] - * - * - * - * @author Dewayne McNair ([EMAIL PROTECTED]) - * @version $Revision: 1.1 $ - */ + * Provides an OS-independent way of shutting down JBoss. This + * works by accessing the JMX server and giving it the shutdown + * command. The host to the JMX server can be passed in as well + * as the port number. If neither is supplied, the defaults of + * localhost and 8082 are used. + * + * Usage: + * + * java org.jboss.Shutdown [host] [port] + * + * + * @author mailto:[EMAIL PROTECTED]";>Dewayne McNair + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.2 $ + */ public class Shutdown { -private static final String command = - "/InvokeAction//DefaultDomain%3Atype%3DShutdown/action=shutdown?action=shutdown"; + private static final String COMMAND = + "/InvokeAction//DefaultDomain%3Atype%3DShutdown/action=shutdown?action=shutdown"; -public static void main (String argv[]) -{ -String host = "localhost"; -String port = "8082"; - -if (argv.length == 1) -host = argv[0]; - -if (argv.length == 2) -port = argv[1]; - -try -{ -URL url = new URL ("http://"; + host + ":" + port + command); -url.getContent(); -} -catch (Exception e) -{ -// we do nothing because even if everything went -// right, ie JBoss is shutdown, we'd get an exception -} -} + /** +* Parse the command line and shutdown the remote server. +* +* @param argv Comamne line arguments. +* +* @throws Exception Invalid port number. +*/ + public static void main(final String argv[]) throws Exception + { + String host = "localhost"; + int port = 8082; + + if (argv.length == 1) { + host = argv[0]; + } + + if (argv.length == 2) { + port = Integer.parseInt(argv[1]); + } + + shutdown(host, port); + } + + /** +* Connect to the JBoss servers HTML JMX adapter and invoke the +* shutdown service. +*/ + public static void shutdown(final String host, final int port) { + try { + URL url = new URL("http", host, port, COMMAND); + url.getContent(); + } + catch (Exception ignore) { + // we do nothing because even if everything went + // right, ie JBoss is shutdown, we'd get an exception + } + } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb DeploymentException.java
User: user57 Date: 01/07/12 18:30:17 Modified:src/main/org/jboss/ejb DeploymentException.java Log: o reindent Revision ChangesPath 1.6 +20 -10jboss/src/main/org/jboss/ejb/DeploymentException.java Index: DeploymentException.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/DeploymentException.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DeploymentException.java 2001/06/18 20:01:21 1.5 +++ DeploymentException.java 2001/07/13 01:30:17 1.6 @@ -7,23 +7,26 @@ package org.jboss.ejb; /** - * This exception is thrown by the ContainerFactory if an EJB application - * could not be deployed + * This exception is thrown by the ContainerFactory if an EJB application + * could not be deployed. * - * @see ContainerFactory - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.5 $ + * @see ContainerFactory + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.6 $ */ public class DeploymentException extends Exception { // Attributes - // The root cause of this exception - Exception cause; + + /** The root cause of this exception */ + protected Exception cause; // Static // Constructors -- + public DeploymentException(String message) { super(message); @@ -32,12 +35,19 @@ public DeploymentException(String message, Exception e) { super(message); - cause = e; } // Public - public Exception getCause() { return cause; } - public String toString() { return cause == null ? super.toString() : super.toString()+", Cause:"+cause; } + public Exception getCause() { + return cause; + } + + public String toString() { + return + cause == null ? + super.toString() : + super.toString() + ", Cause: " + cause; + } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityCache.java
User: user57 Date: 01/07/12 18:33:15 Modified:src/main/org/jboss/ejb EntityCache.java Log: o re-indent & javadoc clean up Revision ChangesPath 1.3 +13 -18jboss/src/main/org/jboss/ejb/EntityCache.java Index: EntityCache.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EntityCache.java 2001/06/18 20:01:21 1.2 +++ EntityCache.java 2001/07/13 01:33:15 1.3 @@ -1,35 +1,30 @@ -package org.jboss.ejb; - /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ - -import java.rmi.RemoteException; -import javax.ejb.NoSuchEntityException; +package org.jboss.ejb; /** - * EntityCaches can work from several keys + * EntityCaches can work from several keys. * - * A cache can use the natural primaryKey from the EJBObject, or DB dependent - * keys or a proprietary key + * A cache can use the natural primaryKey from the EJBObject, or DB + *dependent keys or a proprietary key * - * @see EntityInstanceCache - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury - * @version $Revision: 1.2 $ + * @see EntityInstanceCache + * + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.3 $ */ public interface EntityCache extends InstanceCache { /** * Returns the key used to cache the context - * - * @param id Object id / primary key - * - * @return Cache key - */ - public Object createCacheKey( Object id ); - +* +* @param idObject id / primary key +* @return Cache key +*/ + Object createCacheKey(Object id); } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
I am not sure what you think is interesting, but from time to time, when large jobs are being processed and I end up with a hang I see this every time (note that the line numbers are off by one... but that is not the interesting bit): Full thread dump Classic VM (1.3.1-b24, green threads): "RMI TCP Connection(42)-127.0.0.1" (TID:0x4143d208, sys_thread_t:0x9144730, state:CW) prio=5 at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:420) at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:183) at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:97) at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:153) at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:62) at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127) at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:373) at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:360) at java.lang.reflect.Method.invoke(Native Method) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) at sun.rmi.transport.Transport$1.run(Transport.java:152) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:148) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:706) at java.lang.Thread.run(Thread.java:484) on the MDB side I get things like this: JMXAdaptorService [Thread-12] WARN - Transaction XidImpl [FormatId=257, GlobalId=reason//48, BranchQual=] timed out. status=STATUS_ACTIVE and on the spooler side I get: Customer [Thread-20] WARN - Transaction XidImpl [FormatId=257, GlobalId=reason//158, BranchQual=] timed out. status=STATUS_COMMITING Customer [Thread-21] WARN - Transaction XidImpl [FormatId=257, GlobalId=reason//159, BranchQual=] timed out. status=STATUS_ACTIVE This is very, very weird, because the Customer entity is only used very early on in the process. At other times I will get the same with a Stateless session that controls the clients interation (via the web proxy). *sigh* I guess the only thing that I can really do here, is try and make a test to reproduce this. I am still learning how the internals of the container work, which is driving me a bit loony at the moment (topped off by a large pill of stress and a dab of desperation). --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > Alright. Like I said the best starting point is a thread dump of the VM that > appears to be hanging. Post it if you get one that looks interesting. > > - Original Message - > From: "Jason Dillon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 11, 2001 10:47 PM > Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > > > > It is complicated. > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityPersistenceStore.java
User: user57 Date: 01/07/12 20:25:54 Modified:src/main/org/jboss/ejb EntityPersistenceStore.java Log: o re-indent & clean up javadocs Revision ChangesPath 1.6 +127 -112 jboss/src/main/org/jboss/ejb/EntityPersistenceStore.java Index: EntityPersistenceStore.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityPersistenceStore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- EntityPersistenceStore.java 2001/06/18 20:01:21 1.5 +++ EntityPersistenceStore.java 2001/07/13 03:25:54 1.6 @@ -8,10 +8,7 @@ import java.lang.reflect.Method; import java.rmi.RemoteException; -import java.util.Collection; -import java.util.Map; -import javax.ejb.CreateException; import javax.ejb.FinderException; import javax.ejb.RemoveException; @@ -19,96 +16,108 @@ import org.jboss.util.FinderResults; /** - * This interface is implemented by any EntityBean persistence Store. + * This interface is implemented by any EntityBean persistence Store. * - * These stores just deal with the persistence aspect of storing java objects - * They need not be aware of the EJB semantics. - * - * They act as delegatees for the CMPEntityPersistenceManager class. + * These stores just deal with the persistence aspect of storing java + *objects. They need not be aware of the EJB semantics. They act as + *delegatees for the CMPEntityPersistenceManager class. + * + * @see EntityPersistenceManager * - * @see EntityPersistenceManager - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author mailto:[EMAIL PROTECTED]";>Simone Bordet - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ */ public interface EntityPersistenceStore -extends ContainerPlugin + extends ContainerPlugin { - // Public - - /** - * This method is called whenever an entity is to be created. The persistence manager - * is responsible for handling the results properly wrt the persistent store. - * - * The return is - * The primary key in case of CMP PM - * Null in case of BMP PM (but no store should exist) - * - * @param m the create method in the home interface that was called - * @param args any create parameters - * @param instance the instance being used for this create call - * @return Object, the primary key computed by CMP PM or null for BMP - * @exception Exception - */ - public Object createEntity(Method m, Object[] args, EntityEnterpriseContext instance) + /** +* This method is called whenever an entity is to be created. +* The persistence manager is responsible for handling the results properly +* wrt the persistent store. +* +* @param m the create method in the home interface that was +*called +* @param argsany create parameters +* @param instancethe instance being used for this create call +* @returnThe primary key computed by CMP PM or null for BMP +* +* @throws Exception +*/ + Object createEntity(Method m, + Object[] args, + EntityEnterpriseContext instance) throws Exception; - /** - * This method is called when single entities are to be found. The persistence manager must find out - * whether the wanted instance is available in the persistence store, if so it returns - * the primary key of the object. - * - * @param finderMethod the find method in the home interface that was called - * @param args any finder parameters - * @param instance the instance to use for the finder call - * @return a primary key representing the found entity - * @exception RemoteException thrown if some system exception occurs - * @exception FinderException thrown if some heuristic problem occurs - */ - public Object findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext instance) + /** +* This method is called when single entities are to be found. The +* persistence manager must find out whether the wanted instance is +* available in the persistence store, if so it returns the primary key of +* the object. +* +* @param finderMethodthe find method in the home interface that was +*called +* @param argsany finder parameters +* @param instancethe instance to use
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityPersistenceStore2.java
User: user57 Date: 01/07/12 20:27:21 Modified:src/main/org/jboss/ejb EntityPersistenceStore2.java Log: o re-indent & cleanup javadoc Revision ChangesPath 1.2 +27 -12jboss/src/main/org/jboss/ejb/EntityPersistenceStore2.java Index: EntityPersistenceStore2.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityPersistenceStore2.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- EntityPersistenceStore2.java 2001/06/24 03:02:37 1.1 +++ EntityPersistenceStore2.java 2001/07/13 03:27:21 1.2 @@ -8,19 +8,34 @@ import java.rmi.RemoteException; -public interface EntityPersistenceStore2 extends EntityPersistenceStore { - /** - * Returns a new instance of the bean class or a subclass of the bean class. - * - * @return the new instance - */ - public Object createBeanClassInstance() throws Exception; +/** + * ??? + * + * @author Unknown + * @version $Revision: 1.2 $ + */ +public interface EntityPersistenceStore2 + extends EntityPersistenceStore +{ + /** +* Returns a new instance of the bean class or a subclass of the bean class. +* +* @return the new instance +* +* @throws Exception +*/ + public Object createBeanClassInstance() throws Exception; - /** - * Initializes the instance context. - * This method is called before createEntity, and should - * reset the value of all cmpFields to 0 or null. - */ + /** +* Initializes the instance context. +* +* This method is called before createEntity, and should +*reset the value of all cmpFields to 0 or null. +* +* @param ctx +* +* @throws RemoteException +*/ public void initEntity(EntityEnterpriseContext ctx) throws RemoteException; } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityPersistenceManager.java
User: user57 Date: 01/07/12 20:18:51 Modified:src/main/org/jboss/ejb EntityPersistenceManager.java Log: o re-indent & clean up javadocs Revision ChangesPath 1.8 +113 -98 jboss/src/main/org/jboss/ejb/EntityPersistenceManager.java Index: EntityPersistenceManager.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityPersistenceManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- EntityPersistenceManager.java 2001/06/24 03:06:45 1.7 +++ EntityPersistenceManager.java 2001/07/13 03:18:51 1.8 @@ -10,127 +10,142 @@ import java.rmi.RemoteException; import java.util.Collection; -import javax.ejb.CreateException; -import javax.ejb.FinderException; import javax.ejb.RemoveException; -import org.jboss.util.FinderResults; - /** - * This interface is implemented by any EntityBean persistence managers plugins. - * - * Implementations of this interface are called by other plugins in the container. + * This interface is implemented by any EntityBean persistence managers + * plugins. * - * If the persistence manager wants to, it may attach any instance specific metadata - * to the EntityEnterpriseContext that is passed in method calls. + * Implementations of this interface are called by other plugins in the + *container. If the persistence manager wants to, it may attach any + *instance specific metadata to the EntityEnterpriseContext that is + *passed in method calls. * - * @see EntityContainer - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.7 $ + * @see EntityContainer + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.8 $ */ public interface EntityPersistenceManager extends ContainerPlugin { - // Public - - /** - * Returns a new instance of the bean class or a subclass of the bean class. - * - * @return the new instance - */ - public Object createBeanClassInstance() throws Exception; - - /** - * This method is called whenever an entity is to be created. The persistence manager - * is responsible for calling the ejbCreate methods on the instance and to handle the results - * properly wrt the persistent store. - * - * @param m the create method in the home interface that was called - * @param args any create parameters - * @param instance the instance being used for this create call - */ - public void createEntity(Method m, Object[] args, EntityEnterpriseContext instance) + /** +* Returns a new instance of the bean class or a subclass of the bean class. +* +* @return the new instance +*/ + Object createBeanClassInstance() throws Exception; + + /** +* This method is called whenever an entity is to be created. The +* persistence manager is responsible for calling the ejbCreate methods +* on the instance and to handle the results properly wrt the persistent +* store. +* +* @param m the create method in the home interface that was +*called +* @param argsany create parameters +* @param instancethe instance being used for this create call +*/ + void createEntity(Method m, + Object[] args, + EntityEnterpriseContext instance) throws Exception; - /** - * This method is called when single entities are to be found. The persistence manager must find out - * whether the wanted instance is available in the persistence store, and if so it shall use the ContainerInvoker - * plugin to create an EJBObject to the instance, which is to be returned as result. - * - * @param finderMethod the find method in the home interface that was called - * @param args any finder parameters - * @param instance the instance to use for the finder call - * @return an EJBObject representing the found entity - */ - public Object findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext instance) + /** +* This method is called when single entities are to be found. The +* persistence manager must find out whether the wanted instance is +* available in the persistence store, and if so it shall use the +* ContainerInvoker plugin to create an EJBObject to the instance, which +* is to be returned as result. +* +* @param finderMethodthe find method in the home interface that was +*called +* @param argsany fi
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb LocalContainerInvoker.java
User: user57 Date: 01/07/12 20:29:44 Modified:src/main/org/jboss/ejb LocalContainerInvoker.java Log: o cleaned up Revision ChangesPath 1.4 +51 -53jboss/src/main/org/jboss/ejb/LocalContainerInvoker.java Index: LocalContainerInvoker.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/LocalContainerInvoker.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LocalContainerInvoker.java2001/06/18 20:01:21 1.3 +++ LocalContainerInvoker.java2001/07/13 03:29:44 1.4 @@ -12,64 +12,62 @@ import javax.ejb.EJBLocalObject; /** - * This is an extension to the ContainerInvoker interface. Although some - * implementations of the ContainerInvoker interface may provide access - * to local interfaces, others (e.g. which provide remote distribution) - * will not. Good example: the JRMP delegates do not need to implement - * this interface. + * This is an extension to the ContainerInvoker interface. Although some + * implementations of the ContainerInvoker interface may provide access + * to local interfaces, others (e.g. which provide remote distribution) + * will not. Good example: the JRMP delegates do not need to implement + * this interface. * - * @see ContainerInvoker - * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @see ContainerInvoker + * + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @version $Revision: 1.4 $ */ public interface LocalContainerInvoker extends ContainerPlugin { - // Public - - /** - * This method is called whenever the EJBLocalHome implementation for this - * container is needed. - * - * @return an implementation of the local home interface for this container - */ - public EJBLocalHome getEJBLocalHome(); - -/** - * This method is called whenever an EJBLocalObject implementation for a stateless - * session bean is needed. - * - * @return an implementation of the local interface for this container - */ - public EJBLocalObject getStatelessSessionEJBLocalObject(); - - /** - * This method is called whenever an EJBLocalObject implementation for a stateful - * session bean is needed. - * - * @param id the id of the session - * @return an implementation of the local interface for this container - */ - public EJBLocalObject getStatefulSessionEJBLocalObject(Object id); + /** +* This method is called whenever the EJBLocalHome implementation for this +* container is needed. +* +* @returnan implementation of the local home interface for this +*container +*/ + EJBLocalHome getEJBLocalHome(); + + /** +* This method is called whenever an EJBLocalObject implementation for a +* stateless session bean is needed. +* +* @returnan implementation of the local interface for this container +*/ + EJBLocalObject getStatelessSessionEJBLocalObject(); + + /** +* This method is called whenever an EJBLocalObject implementation for a +* stateful session bean is needed. +* +* @param idthe id of the session +* @return an implementation of the local interface for this container +*/ + EJBLocalObject getStatefulSessionEJBLocalObject(Object id); - /** - * This method is called whenever an EJBLocalObject implementation for an entitybean - * is needed. - * - * @param id the primary key of the entity - * @return an implementation of the local interface for this container - */ - public EJBLocalObject getEntityEJBLocalObject(Object id); - /** - * This method is called whenever a collection of EJBLocalObjects for a collection of primary keys - * is needed. - * - * @param enum enumeration of primary keys - * @return a collection of EJBLocalObjects implementing the remote interface for this container - */ - public Collection getEntityLocalCollection(Collection enum); + /** +* This method is called whenever an EJBLocalObject implementation for an +* entitybean is needed. +* +* @param idthe primary key of the entity +* @return an implementation of the local interface for this container +*/ + EJBLocalObject getEntityEJBLocalObject(Object id); + /** +* This method is called whenever a collection of EJBLocalObjects for a +* collection of primary keys is needed. +* +* @param enumenumeration of primary keys +* @return
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb LocalHomeObjectFactory.java
User: user57 Date: 01/07/12 20:34:40 Modified:src/main/org/jboss/ejb LocalHomeObjectFactory.java Log: cleaned up Revision ChangesPath 1.3 +88 -71jboss/src/main/org/jboss/ejb/LocalHomeObjectFactory.java Index: LocalHomeObjectFactory.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/LocalHomeObjectFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalHomeObjectFactory.java 2001/06/18 20:01:21 1.2 +++ LocalHomeObjectFactory.java 2001/07/13 03:34:40 1.3 @@ -20,83 +20,100 @@ import javax.naming.StringRefAddr; import javax.naming.spi.ObjectFactory; -/** Based on Scott Stark's NonSerializableObjectFactory: +/** + * Based on Scott Stark's NonSerializableObjectFactory * - * @author mailto:[EMAIL PROTECTED]";>Scott Stark. - * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @author mailto:[EMAIL PROTECTED]";>Scott Stark. + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @version $Revision: 1.3 $ */ -public class LocalHomeObjectFactory implements ObjectFactory +public class LocalHomeObjectFactory + implements ObjectFactory { -private static Map applicationMap = Collections.synchronizedMap(new HashMap()); -private static Map containerMap = Collections.synchronizedMap(new HashMap()); - - -/** Place an object into the NonSerializableFactory namespace for subsequent -access by getObject. - -@param key, the name to bind target under. This should typically be the -name that will be used to bind target in the JNDI namespace, but it does -not have to be. -@param target, the non-Serializable object to bind. + private static Map applicationMap = + Collections.synchronizedMap(new HashMap()); + + private static Map containerMap = + Collections.synchronizedMap(new HashMap()); + + /** +* Place an object into the NonSerializableFactory namespace for subsequent +* access by getObject. +* +* @param key the name to bind target under. This should typically +* be the name that will be used to bind target in the +* JNDI namespace, but it does not have to be. +* @param targetthe non-Serializable object to bind. */ -public static synchronized void rebind(String key, Application application, - Container container ) -{ -applicationMap.put(key, application); -containerMap.put( key, container ); -} -/** Place or replace an object in the NonSerializableFactory namespce - for subsequent access by getObject. Any existing binding for key will be - replaced by target. - -/** Remove a binding from the NonSerializableFactory map. - -@param key, the key into the NonSerializableFactory map to remove. -@param target, the non-Serializable object to bind. -@throws NameNotFoundException, thrown if key does not exist in the - NonSerializableFactory map + public static synchronized void rebind(String key, + Application application, + Container container) + { + applicationMap.put(key, application); + containerMap.put(key, container); + } + + /** +* Place or replace an object in the NonSerializableFactory namespce +* for subsequent access by getObject. Any existing binding for key will be +* replaced by target. +* +* Remove a binding from the NonSerializableFactory map. +* +* @param key the key into the NonSerializableFactory map to remove. +* @param targetthe non-Serializable object to bind. +* +* @throws NameNotFoundExceptionthrown if key does not exist in the +* NonSerializableFactory map */ -public static void unbind(String key) throws NameNotFoundException -{ -if( applicationMap.remove(key) == null ) -throw new NameNotFoundException(key+" was not found in the NonSerializableFactory map"); -containerMap.remove(key); -} - -/** Lookup a value from the NonSerializableFactory map. -@return the object bound to key is one exists, null otherwise. + public static void unbind(String key) throws NameNotFoundException + { + if( applicationMap.remove(key) == null ) + throw new NameNotFoundException +(key+" was not found in the NonSerializableFactory map"); + containerMap.remove(key); + } + + /** +* Lookup a value from the NonSerializableFactory map. +* +* @return the object bound to key is one exists, null otherwise. */ -public static Object lookup(S
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb MessageDrivenEnterpriseContext.java
User: user57 Date: 01/07/12 20:39:02 Modified:src/main/org/jboss/ejb MessageDrivenEnterpriseContext.java Log: cleaned up Revision ChangesPath 1.7 +79 -76jboss/src/main/org/jboss/ejb/MessageDrivenEnterpriseContext.java Index: MessageDrivenEnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/MessageDrivenEnterpriseContext.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MessageDrivenEnterpriseContext.java 2001/06/21 05:14:31 1.6 +++ MessageDrivenEnterpriseContext.java 2001/07/13 03:39:02 1.7 @@ -8,15 +8,11 @@ import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; -import java.lang.IllegalStateException; import java.security.Principal; import java.rmi.RemoteException; -import java.rmi.ServerException; -import javax.transaction.UserTransaction; - import javax.ejb.EJBContext; import javax.ejb.EJBHome; import javax.ejb.EJBObject; @@ -32,13 +28,11 @@ /** * Context for message driven beans, based on Stateless. * FIXME - not yet verified agains spec!!! - * * - * @see - * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author Sebastien Alborini - * @version $Revision: 1.6 $ + * @author mailto:[EMAIL PROTECTED]";>Peter Antman. + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author Sebastien Alborini + * @version $Revision: 1.7 $ */ public class MessageDrivenEnterpriseContext extends EnterpriseContext @@ -46,74 +40,83 @@ // Constants - // Attributes -//EJBObject ejbObject; + + //EJBObject ejbObject; MessageDrivenContext ctx; // Static // Constructors -- + public MessageDrivenEnterpriseContext(Object instance, Container con) throws Exception { super(instance, con); ctx = new MessageDrivenContextImpl(); - ((MessageDrivenBean)instance).setMessageDrivenContext(ctx); + ((MessageDrivenBean)instance).setMessageDrivenContext(ctx); try { - Method ejbCreate = instance.getClass().getMethod("ejbCreate", new Class[0]); + Method ejbCreate = instance.getClass().getMethod("ejbCreate", + new Class[0]); ejbCreate.invoke(instance, new Object[0]); } catch (InvocationTargetException e) { - Throwable ex = e.getTargetException(); - if (ex instanceof EJBException) - throw (Exception)ex; - else if (ex instanceof RuntimeException) - throw new EJBException((Exception)ex); // Transform runtime exception into what a bean *should* have thrown - else if (ex instanceof Exception) - throw (Exception)ex; - else - throw (Error)ex; + Throwable ex = e.getTargetException(); + if (ex instanceof EJBException) +throw (Exception)ex; + else if (ex instanceof RuntimeException) +// Transform runtime exception into what a bean *should* +// have thrown +throw new EJBException((Exception)ex); + else if (ex instanceof Exception) +throw (Exception)ex; + else +throw (Error)ex; } } // Public -// FIXME -// Here we have some problems. If we are to use the Stateless stuff, -// should we inherit from StatelessSessionEnterpriseContext or what? - -public void setEJBObject(EJBObject eo) { - throw new Error("Not applicatable for MessageDrivenContext"); - //NOOP - //ejbObject = eo; -} + + // FIXME + // Here we have some problems. If we are to use the Stateless stuff, + // should we inherit from StatelessSessionEnterpriseContext or what? + + public void setEJBObject(EJBObject eo) { + throw new Error("Not applicatable for MessageDrivenContext"); + //NOOP + //ejbObject = eo; + } + public EJBObject getEJBObject() { - throw new Error("Not applicatable for MessageDrivenContext"); - //return ejbObject; + throw new Error("Not applicatable for MessageDrivenContext"); + //return ejbObject; } -// This is used at least in The pool, created there even!!! -// and in interceptors, ugh + + // This is used at least
[JBoss-dev] why is StatefulSessionEnterpriseContext Serializable
It is the only context that implement java.io.Serializable. It also overrides Object() with nothing. Just curious. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb TxEntityMap.java
User: user57 Date: 01/07/12 21:05:47 Modified:src/main/org/jboss/ejb TxEntityMap.java Log: cleaned up Revision ChangesPath 1.2 +62 -53jboss/src/main/org/jboss/ejb/TxEntityMap.java Index: TxEntityMap.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/TxEntityMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TxEntityMap.java 2001/06/15 03:37:29 1.1 +++ TxEntityMap.java 2001/07/13 04:05:47 1.2 @@ -1,66 +1,75 @@ +/* + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb; import java.util.HashMap; import javax.transaction.Transaction; /** - * This class provides a way to find out what entities - * are contained in what transaction. It is used, to find which entities - * to call ejbStore() on when a ejbFind() method is called within a transaction. EJB 2.0- 9.6.4 - * Used in EntitySynchronizationInterceptor - * @author Bill Burke - * @version $Revision: 1.1 $ + * This class provides a way to find out what entities are contained in + * what transaction. It is used, to find which entities to call ejbStore() + * on when a ejbFind() method is called within a transaction. EJB 2.0- 9.6.4 + * Used in EntitySynchronizationInterceptor. + * + * @author Bill Burke + * @version $Revision: 1.2 $ */ public class TxEntityMap { -protected HashMap m_map = new HashMap(); + protected HashMap m_map = new HashMap(); -/** - * associate entity with transaction - */ -public synchronized void associate(Transaction tx, EntityEnterpriseContext entity) -{ - HashMap entityMap = (HashMap)m_map.get(tx); - if (entityMap == null) - { - entityMap = new HashMap(); - m_map.put(tx, entityMap); - } - entityMap.put(entity.getCacheKey(), entity); -} + /** +* associate entity with transaction +*/ + public synchronized void associate(Transaction tx, + EntityEnterpriseContext entity) + { + HashMap entityMap = (HashMap)m_map.get(tx); + if (entityMap == null) + { + entityMap = new HashMap(); + m_map.put(tx, entityMap); + } + entityMap.put(entity.getCacheKey(), entity); + } -/** - * disassociate entity with transaction. When the transaction has no more entities. - * it is removed from this class's internal HashMap. - */ -public synchronized void disassociate(Transaction tx, EntityEnterpriseContext ctx) -{ - HashMap entityMap = (HashMap)m_map.get(tx); - if (entityMap == null) - { - return; - } - entityMap.remove(ctx.getCacheKey()); - // When all entities are gone, cleanup! - // cleanup involves removing the transaction - // from the map - if (entityMap.size() <= 0) - { - m_map.remove(tx); - } -} + /** +* Disassociate entity with transaction. When the transaction has no +* more entities. it is removed from this class's internal HashMap. +*/ + public synchronized void disassociate(Transaction tx, + EntityEnterpriseContext ctx) + { + HashMap entityMap = (HashMap)m_map.get(tx); + if (entityMap == null) + { + return; + } + entityMap.remove(ctx.getCacheKey()); + + // When all entities are gone, cleanup! + // cleanup involves removing the transaction + // from the map + if (entityMap.size() <= 0) + { + m_map.remove(tx); + } + } -/** - * get all EntityEnterpriseContext that are involved with a transaction. - */ -public synchronized Object[] getEntities(Transaction tx) -{ - HashMap entityMap = (HashMap)m_map.get(tx); - if (entityMap == null) // there are no entities associated - { - return new Object[0]; - } - return entityMap.values().toArray(); -} - + /** +* get all EntityEnterpriseContext that are involved with a transaction. +*/ + public synchronized Object[] getEntities(Transaction tx) + { + HashMap entityMap = (HashMap)m_map.get(tx); + if (entityMap == null) // there are no entities associated + { + return new Object[0]; + } + return entityMap.values().toArray(); + } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb StatefulSessionContainer.java
User: user57 Date: 01/07/12 21:06:24 Modified:src/main/org/jboss/ejb StatefulSessionContainer.java Log: cleaned up Revision ChangesPath 1.30 +326 -298 jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java Index: StatefulSessionContainer.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionContainer.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- StatefulSessionContainer.java 2001/07/04 22:44:46 1.29 +++ StatefulSessionContainer.java 2001/07/13 04:06:24 1.30 @@ -14,6 +14,7 @@ import java.util.Enumeration; import java.util.Collection; import java.util.ArrayList; +import java.rmi.RemoteException; import javax.ejb.Handle; import javax.ejb.HomeHandle; @@ -30,51 +31,62 @@ import org.jboss.logging.Logger; /** - * + * The container for stateful session beans. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor - * @author mailto:[EMAIL PROTECTED]";>Marc Fleury - * @version $Revision: 1.29 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @version $Revision: 1.30 $ * - * Revisions - * 20010704 - * - * - Throw an exception when removing a bean in transaction (in remove)? (I dissagree) - * + * Revisions + * 20010704 + * + * Throw an exception when removing a bean in transaction (in remove)? + * (I dissagree) + * */ public class StatefulSessionContainer extends Container -implements ContainerInvokerContainer, InstancePoolContainer + implements ContainerInvokerContainer, InstancePoolContainer { // Constants - // Attributes - // This is the Home interface class + + /** This is the Home interface class */ protected Class homeInterface; - // This is the Remote interface class + /** This is the Remote interface class */ protected Class remoteInterface; - // These are the mappings between the home interface methods and the container methods + /** +* These are the mappings between the home interface methods and the +* container methods. +*/ protected Map homeMapping; - // These are the mappings between the remote interface methods and the bean methods + /** +* These are the mappings between the remote interface methods and the +* bean methods. +*/ protected Map beanMapping; - // This is the container invoker for this container + /** This is the container invoker for this container */ protected ContainerInvoker containerInvoker; - // This is the first interceptor in the chain. The last interceptor must be provided by the container itself + /** +* This is the first interceptor in the chain. The last interceptor must +* be provided by the container itself. +*/ protected Interceptor interceptor; - // This is the instancepool that is to be used + /** This is the instancepool that is to be used */ protected InstancePool instancePool; - // This is the persistence manager for this container + /** This is the persistence manager for this container */ protected StatefulSessionPersistenceManager persistenceManager; - + + /** The instance cache. */ protected InstanceCache instanceCache; // Static @@ -82,10 +94,11 @@ // Constructors -- // Public + public void setContainerInvoker(ContainerInvoker ci) { if (ci == null) -throw new IllegalArgumentException("Null invoker"); + throw new IllegalArgumentException("Null invoker"); this.containerInvoker = ci; ci.setContainer(this); @@ -93,13 +106,13 @@ public ContainerInvoker getContainerInvoker() { -return containerInvoker; + return containerInvoker; } -public LocalContainerInvoker getLocalContainerInvoker() -{ - return localContainerInvoker; -} + public LocalContainerInvoker getLocalContainerInvoker() + { + return localContainerInvoker; + } public void setInstanceCache(InstanceCache ic) { @@ -115,7 +128,7 @@ public void setInstancePool(InstancePool ip) { if (ip == null) -throw new IllegalArgument
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb StatefulSessionEnterpriseContext.java
User: user57 Date: 01/07/12 21:07:51 Modified:src/main/org/jboss/ejb StatefulSessionEnterpriseContext.java Log: cleaned up Revision ChangesPath 1.14 +58 -42 jboss/src/main/org/jboss/ejb/StatefulSessionEnterpriseContext.java Index: StatefulSessionEnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatefulSessionEnterpriseContext.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- StatefulSessionEnterpriseContext.java 2001/06/21 05:14:31 1.13 +++ StatefulSessionEnterpriseContext.java 2001/07/13 04:07:51 1.14 @@ -7,6 +7,10 @@ package org.jboss.ejb; import java.io.IOException; +import java.io.Serializable; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + import java.rmi.RemoteException; import javax.ejb.EJBContext; @@ -16,93 +20,107 @@ import javax.ejb.EJBLocalObject; import javax.ejb.SessionBean; import javax.ejb.SessionContext; - -import javax.transaction.UserTransaction; +import org.jboss.logging.Logger; import org.jboss.metadata.SessionMetaData; - /** - * + * The enterprise context for stateful session beans. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor - * @version $Revision: 1.13 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @version $Revision: 1.14 $ */ public class StatefulSessionEnterpriseContext extends EnterpriseContext - implements java.io.Serializable + implements Serializable { // Constants - // Attributes + private EJBObject ejbObject; private EJBLocalObject ejbLocalObject; - private SessionContext ctx; // Static // Constructors -- + public StatefulSessionEnterpriseContext(Object instance, Container con) throws RemoteException { super(instance, con); - ctx = new StatefulSessionContextImpl(); + ctx = new StatefulSessionContextImpl(); ((SessionBean)instance).setSessionContext(ctx); } // Public - public void discard() - throws RemoteException + + public void discard() throws RemoteException { - // Do nothing + // Do nothing } + public EJBContext getEJBContext() { - return ctx; + return ctx; } - // During activation of stateful session beans we replace the instance by the one read from the file + /** +* During activation of stateful session beans we replace the instance +* by the one read from the file. +*/ public void setInstance(Object instance) -{ - this.instance = instance; -try -{ - ((SessionBean)instance).setSessionContext(ctx); -} -catch (Exception x) -{ -org.jboss.logging.Logger.exception(x); -} -} - - public void setEJBObject(EJBObject eo) { ejbObject = eo; } - public EJBObject getEJBObject() { return ejbObject; } - public void setEJBLocalObject(EJBLocalObject eo) { ejbLocalObject = eo; } - public EJBLocalObject getEJBLocalObject() { return ejbLocalObject; } + { + this.instance = instance; + try + { + ((SessionBean)instance).setSessionContext(ctx); + } + catch (Exception x) + { + Logger.exception(x); + } + } + + public void setEJBObject(EJBObject eo) { + ejbObject = eo; + } + + public EJBObject getEJBObject() { + return ejbObject; + } + + public void setEJBLocalObject(EJBLocalObject eo) { + ejbLocalObject = eo; + } + + public EJBLocalObject getEJBLocalObject() { + return ejbLocalObject; + } - public SessionContext getSessionContext() - { - return ctx; - } + public SessionContext getSessionContext() + { + return ctx; + } // Package protected - // Protected - // Private --- - private void writeObject(java.io.ObjectOutputStream out) + + private void writeObject(ObjectOutputStream out) throws IOException, ClassNotF
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb StatelessSessionEnterpriseContext.java
User: user57 Date: 01/07/12 21:08:01 Modified:src/main/org/jboss/ejb StatelessSessionEnterpriseContext.java Log: cleaned up Revision ChangesPath 1.12 +39 -31 jboss/src/main/org/jboss/ejb/StatelessSessionEnterpriseContext.java Index: StatelessSessionEnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionEnterpriseContext.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- StatelessSessionEnterpriseContext.java2001/06/21 05:14:31 1.11 +++ StatelessSessionEnterpriseContext.java2001/07/13 04:08:01 1.12 @@ -9,28 +9,20 @@ import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; import java.rmi.RemoteException; -import java.rmi.ServerException; import javax.ejb.EJBContext; -import javax.ejb.EJBHome; import javax.ejb.EJBLocalObject; import javax.ejb.EJBObject; import javax.ejb.SessionContext; import javax.ejb.SessionBean; import javax.ejb.EJBException; -import javax.transaction.UserTransaction; - -import org.jboss.metadata.SessionMetaData; - - /** - * + * The enterprise context for stateless session beans. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @author Sebastien Alborini - * @version $Revision: 1.11 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author Sebastien Alborini + * @version $Revision: 1.12 $ */ public class StatelessSessionEnterpriseContext extends EnterpriseContext @@ -38,6 +30,7 @@ // Constants - // Attributes + EJBObject ejbObject; EJBLocalObject ejbLocalObject; SessionContext ctx; @@ -45,52 +38,67 @@ // Static // Constructors -- + public StatelessSessionEnterpriseContext(Object instance, Container con) throws Exception { super(instance, con); ctx = new SessionContextImpl(); - - ((SessionBean)instance).setSessionContext(ctx); + ((SessionBean)instance).setSessionContext(ctx); + try { Method ejbCreate = instance.getClass().getMethod("ejbCreate", new Class[0]); ejbCreate.invoke(instance, new Object[0]); } catch (InvocationTargetException e) { - Throwable ex = e.getTargetException(); - if (ex instanceof EJBException) - throw (Exception)ex; - else if (ex instanceof RuntimeException) - throw new EJBException((Exception)ex); // Transform runtime exception into what a bean *should* have thrown - else if (ex instanceof Exception) - throw (Exception)ex; - else - throw (Error)ex; + Throwable ex = e.getTargetException(); + if (ex instanceof EJBException) +throw (Exception)ex; + else if (ex instanceof RuntimeException) +throw new EJBException((Exception)ex); // Transform runtime exception into what a bean *should* have thrown + else if (ex instanceof Exception) +throw (Exception)ex; + else +throw (Error)ex; } } // Public - public void setEJBObject(EJBObject eo) { ejbObject = eo; } - public EJBObject getEJBObject() { return ejbObject; } - public void setEJBLocalObject(EJBLocalObject eo) { ejbLocalObject = eo; } - public EJBLocalObject getEJBLocalObject() { return ejbLocalObject; } + public void setEJBObject(EJBObject eo) { + ejbObject = eo; + } + + public EJBObject getEJBObject() { + return ejbObject; + } + + public void setEJBLocalObject(EJBLocalObject eo) { + ejbLocalObject = eo; + } + + public EJBLocalObject getEJBLocalObject() { + return ejbLocalObject; + } + public SessionContext getSessionContext() { -return ctx; + return ctx; } // EnterpriseContext overrides --- - public void discard() - throws RemoteException + + public void discard() throws RemoteException { ((SessionBean)instance).ejbRemove(); } + public EJBContext getEJBContext() { return ctx; } + // Package protected - // Protected - @@ -98,6 +106,7 @@ // Private --
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityContainer.java
User: user57 Date: 01/07/12 21:08:18 Modified:src/main/org/jboss/ejb EntityContainer.java Log: cleaned up Revision ChangesPath 1.45 +172 -165 jboss/src/main/org/jboss/ejb/EntityContainer.java Index: EntityContainer.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityContainer.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- EntityContainer.java 2001/07/03 22:54:34 1.44 +++ EntityContainer.java 2001/07/13 04:08:18 1.45 @@ -1,13 +1,14 @@ /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; +import java.rmi.RemoteException; import java.security.Principal; import java.util.Map; import java.util.HashMap; @@ -31,76 +32,84 @@ import org.jboss.util.SerializableEnumeration; /** -* This is a Container for EntityBeans (both BMP and CMP). -* -* -* @see Container -* @see EntityEnterpriseContext -* @author mailto:[EMAIL PROTECTED]";>Rickard Öberg -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini -* @author mailto:[EMAIL PROTECTED]";>Daniel OConnor -* @author Bill Burke -* @version $Revision: 1.44 $ -* -* -* Revisions: -* -* 20010701 marc fleury: -* -* Transaction to context wiring was moved to the instance interceptor -* -*/ - - + * This is a Container for EntityBeans (both BMP and CMP). + * + * @see Container + * @see EntityEnterpriseContext + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @author Bill Burke + * @version $Revision: 1.45 $ + * + * Revisions: + * + * 20010701 marc fleury: + * + * Transaction to context wiring was moved to the instance interceptor + * + */ public class EntityContainer -extends Container -implements ContainerInvokerContainer, InstancePoolContainer + extends Container + implements ContainerInvokerContainer, InstancePoolContainer { // Constants - // Attributes - // This is the Home interface class + /** This is the Home interface class. */ protected Class homeInterface; - // This is the Remote interface class + /** This is the Remote interface class. */ protected Class remoteInterface; - // These are the mappings between the home interface methods and the container methods + /** +* These are the mappings between the home interface methods and the +* container methods. +*/ protected Map homeMapping; - // These are the mappings between the remote interface methods and the bean methods + /** +* These are the mappings between the remote interface methods and the +* bean methods. +*/ protected Map beanMapping; - - // This is the container invoker for this container + /** This is the container invoker for this container */ protected ContainerInvoker containerInvoker; - // This is the persistence manager for this container + /** This is the persistence manager for this container */ protected EntityPersistenceManager persistenceManager; - // This is the instance cache for this container + /** This is the instance cache for this container */ protected InstanceCache instanceCache; - // This is the instancepool that is to be used + /** This is the instancepool that is to be used */ protected InstancePool instancePool; - // This provides a way to find the entities that are part of a given transaction - // EntitySynchronizationInterceptor and InstanceSynchronization manage - // this instance. + /** +* This provides a way to find the entities that are part of a given +* transaction EntitySynchronizationInterceptor and InstanceSynchronization +* manage this instance. +*/ protected TxEntityMap txEntityMap = new TxEntityMap(); - // This is the first interceptor in the chain. The last interceptor must be provided by the container itself + /** +* This is the first interceptor in the chain. The last interceptor must +* be provided by the container itself. +*/ protected Interceptor interceptor; // Public ---
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb EntityEnterpriseContext.java
User: user57 Date: 01/07/12 21:10:15 Modified:src/main/org/jboss/ejb EntityEnterpriseContext.java Log: cleaned up Revision ChangesPath 1.21 +197 -191 jboss/src/main/org/jboss/ejb/EntityEnterpriseContext.java Index: EntityEnterpriseContext.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/EntityEnterpriseContext.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- EntityEnterpriseContext.java 2001/07/03 22:55:29 1.20 +++ EntityEnterpriseContext.java 2001/07/13 04:10:15 1.21 @@ -1,9 +1,9 @@ /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb; import java.rmi.RemoteException; @@ -20,194 +20,200 @@ import javax.transaction.Transaction; /** -*The EntityEnterpriseContext is used to associate EntityBean instances with metadata about it. -* -*@see EnterpriseContext -*@author mailto:[EMAIL PROTECTED]";>Rickard Öberg -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @author mailto:[EMAIL PROTECTED]";>Daniel OConnor -*@version $Revision: 1.20 $ -* -* Revisions -* 20010703 marcf -* -* - setInvoked replaced by "isTxSynchronized", the reason being that we use it for Tx registration -* -*/ + * The EntityEnterpriseContext is used to associate EntityBean instances + * with metadata about it. + * + * @see EnterpriseContext + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @version $Revision: 1.21 $ + * + * Revisions + * 20010703 marcf + * + * setInvoked replaced by "isTxSynchronized", the reason being that we + * use it for Tx registration. + * + */ public class EntityEnterpriseContext -extends EnterpriseContext + extends EnterpriseContext { - // Attributes - EJBObject ejbObject; - EJBLocalObject ejbLocalObject; - EntityContext ctx; - - // True if this instance has been registered with the TM for transactional demarcation - boolean isTxSynchronized = false; - - // True if this instances' state is valid - // when a bean is called the state is not synchronized with the DB - // but "valid" as long as the transaction runs - boolean valid = false; - - // The persistence manager may attach any metadata it wishes to this context here - private Object persistenceCtx; - - //The cacheKey for this context - CacheKey key; - - // Constructors -- - public EntityEnterpriseContext(Object instance, Container con) - throws RemoteException - { - super(instance, con); - ctx = new EntityContextImpl(); - ((EntityBean)instance).setEntityContext(ctx); - } - - // Public - - public void clear() { - - super.clear(); - this.isTxSynchronized = false; - this.valid = false; - key = null; - persistenceCtx = null; - ejbObject = null; - } - - public void discard() - throws RemoteException - { - ((EntityBean)instance).unsetEntityContext(); - } - - public EJBContext getEJBContext() - { - return ctx; - } - - public void setEJBObject(EJBObject eo) - { - ejbObject = eo; - } - - public EJBObject getEJBObject() - { - // Context can have no EJBObject (created by finds) in which case we need to wire it at call time - - return ejbObject; - } - - public void setEJBLocalObject( EJBLocalObject eo ) - { - ejbLocalObject = eo; - } - - public EJBLocalObject getEJBLocalObject() - { - return ejbLocalObject; - } - - public void setCacheKey(Object key) { - this.key = (CacheKey) key; - } - - public CacheKey getCacheKey() { - return key; - } - - public void setPersistenceContext(Object ctx) - { - this.persistenceCtx = ctx; - } - - public Object getPersistenceContext() - { - return persistenceCtx; - } - - /* - public void
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb StatelessSessionContainer.java
User: user57 Date: 01/07/12 21:06:12 Modified:src/main/org/jboss/ejb StatelessSessionContainer.java Log: cleaned up Revision ChangesPath 1.22 +522 -487 jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java Index: StatelessSessionContainer.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/StatelessSessionContainer.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- StatelessSessionContainer.java2001/06/18 20:01:21 1.21 +++ StatelessSessionContainer.java2001/07/13 04:06:12 1.22 @@ -1,9 +1,9 @@ /* -* JBoss, the OpenSource EJB server -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource EJB server + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package org.jboss.ejb; import java.lang.reflect.InvocationTargetException; @@ -11,6 +11,7 @@ import java.security.Principal; import java.util.Map; import java.util.HashMap; +import java.rmi.RemoteException; import javax.ejb.Handle; import javax.ejb.HomeHandle; @@ -22,543 +23,577 @@ import javax.ejb.CreateException; import javax.ejb.RemoveException; import javax.ejb.EJBException; -import org.jboss.logging.Logger; +import org.jboss.logging.Logger; /** -* StatelessSessionContainer -* -* @see -* @author mailto:[EMAIL PROTECTED]";>Rickard Öberg -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury -* @author mailto:[EMAIL PROTECTED]";>Daniel OConnor -* @version $Revision: 1.21 $ -*/ + * The container for stateless session beans. + * + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury + * @author mailto:[EMAIL PROTECTED]";>Daniel OConnor + * @version $Revision: 1.22 $ + */ public class StatelessSessionContainer -extends Container -implements ContainerInvokerContainer, InstancePoolContainer + extends Container + implements ContainerInvokerContainer, InstancePoolContainer { -// Constants - + // Constants - -// Attributes -// This is the Home interface class -protected Class homeInterface; + // Attributes + + /** This is the Home interface class */ + protected Class homeInterface; -// This is the Remote interface class -protected Class remoteInterface; - - // These are the mappings between the home interface methods and the container methods -protected Map homeMapping; - -// These are the mappings between the remote interface methods and the bean methods -protected Map beanMapping; + /** This is the Remote interface class */ + protected Class remoteInterface; -// This is the container invoker for this container -protected ContainerInvoker containerInvoker; - -// This is the instancepool that is to be used -protected InstancePool instancePool; + /** +* These are the mappings between the home interface methods and the +* container methods. +*/ + protected Map homeMapping; -// This is the first interceptor in the chain. The last interceptor must be provided by the container itself -protected Interceptor interceptor; + /** +* These are the mappings between the remote interface methods and the +* bean methods. +*/ + protected Map beanMapping; -// Static + /** This is the container invoker for this container */ + protected ContainerInvoker containerInvoker; -// Constructors -- + /** This is the instancepool that is to be used */ + protected InstancePool instancePool; -// Public -public void setContainerInvoker(ContainerInvoker ci) -{ -if (ci == null) -throw new IllegalArgumentException("Null invoker"); - -this.containerInvoker = ci; -ci.setContainer(this); -} + /** +* This is the first interceptor in the chain. The last interceptor must +* be provided by the container itself +*/ + protected Interceptor interceptor; -public ContainerInvoker getContainerInvoker() -{ -return containerInvoker; -} + // Static -public LocalContainerInvoker getLocalContainerInvoker()
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins EntityInstanceInterceptor.java
User: user57 Date: 01/07/13 14:50:27 Modified:src/main/org/jboss/ejb/plugins EntityInstanceInterceptor.java Log: o removed extra space in class header javadoc (it was driving me a bit batty) Revision ChangesPath 1.37 +2 -2 jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java Index: EntityInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- EntityInstanceInterceptor.java2001/07/13 08:54:11 1.36 +++ EntityInstanceInterceptor.java2001/07/13 21:50:26 1.37 @@ -58,7 +58,7 @@ * * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author mailto:[EMAIL PROTECTED]";>Scott Stark - * @version $Revision: 1.36 $ + * @version $Revision: 1.37 $ * * Revisions: * 2001/06/28: marcf @@ -77,7 +77,6 @@ * * Handle a race condition when there is no ctx transaction * - */ public class EntityInstanceInterceptor extends AbstractInterceptor @@ -89,6 +88,7 @@ protected EntityContainer container; // Static + /** Use a JBoss custom log4j category for trace level logging */ static JBossCategory log = (JBossCategory) JBossCategory.getInstance(EntityInstanceInterceptor.class); ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins MessageDrivenInstanceInterceptor.java
User: user57 Date: 01/07/13 15:35:30 Modified:src/main/org/jboss/ejb/plugins MessageDrivenInstanceInterceptor.java Log: o cleaned up Revision ChangesPath 1.5 +34 -30 jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java Index: MessageDrivenInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MessageDrivenInstanceInterceptor.java 2001/06/18 20:01:23 1.4 +++ MessageDrivenInstanceInterceptor.java 2001/07/13 22:35:30 1.5 @@ -11,46 +11,50 @@ import org.jboss.ejb.Container; import org.jboss.ejb.MessageDrivenContainer; import org.jboss.ejb.MethodInvocation; -import org.jboss.logging.Logger; + /** - * This container acquires the given instance. This must be used after - * the EnvironmentInterceptor, since acquiring instances requires a proper - * JNDI environment to be set - * For MessageDriven Beans, we inherit the StatelessSession for now, - * since message driven beans is much like them + * This container acquires the given instance. This must be used after + * the EnvironmentInterceptor, since acquiring instances requires a proper + * JNDI environment to be set. + * + * For MessageDriven Beans, we inherit the StatelessSession for now, + *since message driven beans is much like them. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.4 $ + * @author mailto:[EMAIL PROTECTED]";>Peter Antman. + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg + * @version $Revision: 1.5 $ */ public class MessageDrivenInstanceInterceptor extends StatelessSessionInstanceInterceptor { -protected MessageDrivenContainer container; + protected MessageDrivenContainer container; -public void setContainer(Container container) + public void setContainer(final Container container) { - this.container = (MessageDrivenContainer)container; + this.container = (MessageDrivenContainer)container; } -// Overriden here, since these bastards don't have homes -public Object invokeHome(MethodInvocation mi) + /** +* Message driven beans do not have homes. +* +* @throws Error Not valid for MessageDriven beans +*/ + public Object invokeHome(final MethodInvocation mi) throws Exception { - throw new Error("Not valid for MessageDriven beans"); + throw new Error("Not valid for MessageDriven beans"); } -// Interceptor implementation -- - + + // Interceptor implementation -- - public Object invoke(MethodInvocation mi) + public Object invoke(final MethodInvocation mi) throws Exception { // Get context mi.setEnterpriseContext(container.getInstancePool().get()); - // There is no need for synchronization since the instance is always fresh also there should - // never be a tx associated with the instance. + // There is no need for synchronization since the instance is always + // fresh also there should never be a tx associated with the instance. try { @@ -58,21 +62,21 @@ return getNext().invoke(mi); } catch (RuntimeException e) // Instance will be GC'ed at MI return { - mi.setEnterpriseContext(null); - throw e; + mi.setEnterpriseContext(null); + throw e; } catch (RemoteException e) // Instance will be GC'ed at MI return { - mi.setEnterpriseContext(null); - throw e; + mi.setEnterpriseContext(null); + throw e; } catch (Error e) // Instance will be GC'ed at MI return { - mi.setEnterpriseContext(null); - throw e; + mi.setEnterpriseContext(null); + throw e; } finally { - // Return context - if (mi.getEnterpriseContext() != null) - container.getInstancePool().free(mi.getEnterpriseContext()); + // Return context + if (mi.getEnterpriseContext() != null) +container.getInstancePool().free(mi.getEnterpriseContext()); } } } ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins MessageDrivenInstanceInterceptor.java
User: user57 Date: 01/07/13 15:48:23 Modified:src/main/org/jboss/ejb/plugins MessageDrivenInstanceInterceptor.java Log: o changing to extend from AbstractInterceptor instead of StatelessSessionInstanceInterceptor. The only bit that SSII had that MDII did not was a getContainer() method, all other. Revision ChangesPath 1.6 +22 -6 jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java Index: MessageDrivenInstanceInterceptor.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MessageDrivenInstanceInterceptor.java 2001/07/13 22:35:30 1.5 +++ MessageDrivenInstanceInterceptor.java 2001/07/13 22:48:23 1.6 @@ -16,28 +16,44 @@ * This container acquires the given instance. This must be used after * the EnvironmentInterceptor, since acquiring instances requires a proper * JNDI environment to be set. - * - * For MessageDriven Beans, we inherit the StatelessSession for now, - *since message driven beans is much like them. * * @author mailto:[EMAIL PROTECTED]";>Peter Antman. * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.6 $ */ public class MessageDrivenInstanceInterceptor - extends StatelessSessionInstanceInterceptor + extends AbstractInterceptor { + /** The container for this interceptor. */ protected MessageDrivenContainer container; + /** +* Set the container for this interceptor. +* +* @param containerA MessageDrivenContainer. +* +* @throws ClassCastExceptionNot a MessageDrivenContainer. +*/ public void setContainer(final Container container) { this.container = (MessageDrivenContainer)container; } /** +* Return the container for this interceptor. +* +* @return The MessageDrivenContainer for this interceptor. +*/ + public Container getContainer() + { + return container; + } + + /** * Message driven beans do not have homes. * -* @throws Error Not valid for MessageDriven beans +* @throws ErrorNot valid for MessageDriven beans. */ public Object invokeHome(final MethodInvocation mi) throws Exception ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
I am still seeing a hang in EntityInstanceInterceptor =( I think I am starting to understand the problem more, which is good. Unfortunately I still don't have a good idea for which chunk of code is at fault. In reference to the complicated scenario that I explained before, I might be able to provide some insight. I think that there are a few different problems here. I re-ran a large test but removed the last vm and mdb that actually processed the requests. This works with no hangs. I then started up the end MDB to process all of the messages from the router, it looks like it processed about 16 requests then hung. The MDB thread will hang calling a method from some internal code, which will wait() for a notification. Another internal thread is invoking a call back which will collect the results of the work and send the response. This is hanging in socket io in the JBossMQ RMI IL: at java.net.SocketInputStream.socketRead(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:86) at java.io.BufferedInputStream.fill(BufferedInputStream.java:186) at java.io.BufferedInputStream.read(BufferedInputStream.java:204) at java.io.DataInputStream.readByte(DataInputStream.java:222) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:186) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) at org.jbossmq.distributed.server.DistributedJMSServerRMIImpl_Stub.addMessage(Unknown Source) at org.jbossmq.SpyConnection.sendToServer(SpyConnection.java:373) at org.jbossmq.SpySession.sendMessage(SpySession.java:362) at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:103) at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:62) at This will essentially lock the vm (it is not spinning or wedged, but will not do anything else). Since the internal code is waiting for this call back to finish before it call notify, the MDB thread TX will timeout. The first odd thing is that when it times out a message is logged, but the thread still hangs. Should it be interrupted or something? Now I am still not sure why, then all of these complenets are running together that when the end MDB hangs that request creation beans also hang (in the EntityInstanceInterceptor). I think that this might be releated to the JBossMQ changes, since I think that both vms might be hung waiting on some io from JBossMQ. I might try running this all inside of one vm to see if the same problem happens, which I would guess it would. I might also try turning up the client poll rate again, with the end MDB turned off to see if there is still a hang due to contention (as I was seeing before). So I think we are making progress, but it looks like there is still something wrong. What should happen when a transaction times out? --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
I just re-ran this test with everything inside of the same vm and did not run into any hangs. I also turned up the client poll rate to sleep only for a second (instead of 1 minute). I am running even bigger tests now, still all in the same vm. After that completes, if it completes I should say, I will try moving the router outside of the vm. I am guessing that will fail. If it does, I am going to try using the JBossMQ jars from the last release that our software runs under (I think that is a 2.3, but I am not sure). --jason On Fri, 13 Jul 2001, Jason Dillon wrote: > I am still seeing a hang in EntityInstanceInterceptor =( I think I am > starting to understand the problem more, which is good. Unfortunately I > still don't have a good idea for which chunk of code is at fault. > > In reference to the complicated scenario that I explained before, I might > be able to provide some insight. I think that there are a few different > problems here. > > I re-ran a large test but removed the last vm and mdb that actually > processed the requests. This works with no hangs. I then started up the > end MDB to process all of the messages from the router, it looks like it > processed about 16 requests then hung. > > The MDB thread will hang calling a method from some internal code, which > will wait() for a notification. Another internal thread is invoking a call > back which will collect the results of the work and send the response. This > is hanging in socket io in the JBossMQ RMI IL: > > > at java.net.SocketInputStream.socketRead(Native Method) > at java.net.SocketInputStream.read(SocketInputStream.java:86) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:186) > at java.io.BufferedInputStream.read(BufferedInputStream.java:204) > at java.io.DataInputStream.readByte(DataInputStream.java:222) > at > sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:186) > at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) > at > org.jbossmq.distributed.server.DistributedJMSServerRMIImpl_Stub.addMessage(Unknown > Source) > at org.jbossmq.SpyConnection.sendToServer(SpyConnection.java:373) > at org.jbossmq.SpySession.sendMessage(SpySession.java:362) > at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:103) > at org.jbossmq.SpyQueueSender.send(SpyQueueSender.java:62) > at > > > > This will essentially lock the vm (it is not spinning or wedged, but will > not do anything else). Since the internal code is waiting for this call > back to finish before it call notify, the MDB thread TX will timeout. > > The first odd thing is that when it times out a message is logged, but the > thread still hangs. Should it be interrupted or something? > > Now I am still not sure why, then all of these complenets are running > together that when the end MDB hangs that request creation beans also hang > (in the EntityInstanceInterceptor). I think that this might be releated to > the JBossMQ changes, since I think that both vms might be hung waiting on > some io from JBossMQ. > > I might try running this all inside of one vm to see if the same problem > happens, which I would guess it would. I might also try turning up the > client poll rate again, with the end MDB turned off to see if there is still > a hang due to contention (as I was seeing before). > > So I think we are making progress, but it looks like there is still > something wrong. > > What should happen when a transaction times out? > > --jason > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
I will have to reproduce it again... something went terribly wrong, the vm spun and I had to reboot to regain control =( --jason On Fri, 13 Jul 2001, Scott M Stark wrote: > Do you have the timeout msg that is logged? > > > > > The first odd thing is that when it times out a message is logged, but the > > thread still hangs. Should it be interrupted or something? > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
Ok, I have verified that if the jbossmq.jar (and jbossmq-client.jar) from the 2.1-BETA-Mar-26-2001 build are used that everything works fine. The only thing I had to change was the router jboss.jcml changing INVM stuff to RMI (which it was not even using) and remove the INVM stuff from jbossmq.xml. I ran the exact same test and it finished flawlessly. --jason On Fri, 13 Jul 2001, Scott M Stark wrote: > Do you have the timeout msg that is logged? > > > > > The first odd thing is that when it times out a message is logged, but the > > thread still hangs. Should it be interrupted or something? > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
Not sure. I think a start might be to seperate the JBossMQService into a seperate VM when running tests. So run the testsuite in one vm, with its JMS config pointed to the vm running JBossMQService. I do not know if just by doing that if you will see the problem, but it might get you closer. On a similar note, I think that it might be a good idea to setup some multi-vm tests, but I am stuck on what the best way to do that would be. I am thinking that we could define a few extra config's like test1...testn (or something like that). Perhaps the current default config would remain the same for running all invm test, then test1 through testn would be used for multi vm tests. We will definatly have to come up with something to test distributed transactions and such. There are some tricky bits, like how to deploy (do you just deploy to one vm, leaving the other vanilla from its startup config). I think as a start this might work and possibly even produce the problem that I am seeing, though I am not sure. It might be that I need to deploy to at least to 2 vm's with a total of 3, one for the seperate JMS server). I am going to ponder this some more, if you or anyone has any ideas I would like to hear them. In the mean time I am going to backport some parts of my app to the previous version of JBoss, which might take some time, but will releave some stress. I also wanted to write up something on the build system that I started using here at work and with some of my other projects, which I think will fit in perfectly here. I was going to write that sooner, but then I ran into this wall. =| --jason On Sat, 14 Jul 2001, Hiram Chirino wrote: > > Jason, > > then I have a feeling that this could have something to do with the changes > that I recently made to the threading model that JBossMQ uses. > > What's the easiest way you think I could reproduce the bug on my systems?? > > Regards, > Hiram > > >From: Jason Dillon <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: <[EMAIL PROTECTED]> > >Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > >Date: Fri, 13 Jul 2001 19:38:42 -0700 (PDT) > > > >Ok, I have verified that if the jbossmq.jar (and jbossmq-client.jar) from > >the 2.1-BETA-Mar-26-2001 build are used that everything works fine. The > >only thing I had to change was the router jboss.jcml changing INVM stuff to > >RMI (which it was not even using) and remove the INVM stuff from > >jbossmq.xml. > > > >I ran the exact same test and it finished flawlessly. > > > >--jason > > > > > >On Fri, 13 Jul 2001, Scott M Stark wrote: > > > > > Do you have the timeout msg that is logged? > > > > > > > > > > > The first odd thing is that when it times out a message is logged, but > >the > > > > thread still hangs. Should it be interrupted or something? > > > > > > > > > > > > > > > > ___ > > > Jboss-development mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > >___ > >Jboss-development mailing list > >[EMAIL PROTECTED] > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
Isn't it SIGQUIT... SIGHUP does not seem to produce a thread dump on Linux. --jason On Wed, 11 Jul 2001, Scott M Stark wrote: > Generate a thread dump using SIGHUP or Ctrl-\ on unix/linux or Ctrl-Break on > win32. > This should be the first step to any deadlock/starvation investigation. The > sun vm > tends to produce garbage dumps with HotSpot so turn it off using > the -classic > switch. > > MDBs are involed in the lock unit test so what are you running? > > - Original Message - > From: "Jason Dillon" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 11, 2001 8:57 PM > Subject: [JBoss-dev] EntityInstanceInterceptor change > > > > What was the problem... the diff is more or less the entire file. I am > > curious, because I am still running into a hang, though it seems like it > > might be MDB or SB related (not sure at the moment). > > > > --jason > > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/pluginsEntityInstanceInterceptor.java
Wow.. that was a very large diff for a simple change. Did this include DOS cr/lf ? --jason On Mon, 16 Jul 2001, Scott M Stark wrote: > User: starksm > Date: 01/07/16 20:26:51 > > Modified:src/main/org/jboss/ejb/plugins Tag: Branch_2_2 > EntityInstanceInterceptor.java > Log: > Add a simple wait(1000) to avoid the spin wait that currently exists in the > presence of transcation contention. > > Revision ChangesPath > No revision > > > No revision > > > 1.28.2.1 +273 -265 >jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java > > Index: EntityInstanceInterceptor.java > === > RCS file: >/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/EntityInstanceInterceptor.java,v > retrieving revision 1.28 > retrieving revision 1.28.2.1 > diff -u -r1.28 -r1.28.2.1 > --- EntityInstanceInterceptor.java 2001/01/12 00:05:53 1.28 > +++ EntityInstanceInterceptor.java 2001/07/17 03:26:50 1.28.2.1 > @@ -1,9 +1,9 @@ >/* > -* JBoss, the OpenSource EJB server > -* > -* Distributable under LGPL license. > -* See terms of license at gnu.org. > -*/ > + * JBoss, the OpenSource EJB server > + * > + * Distributable under LGPL license. > + * See terms of license at gnu.org. > + */ >package org.jboss.ejb.plugins; > >import java.lang.reflect.Method; > @@ -39,272 +39,280 @@ >import org.jboss.util.Sync; > >/** > -* This container acquires the given instance. > -* > -* @see > -* @author Rickard Öberg ([EMAIL PROTECTED]) > -* @author mailto:[EMAIL PROTECTED]";>Marc Fleury > -* @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini > -* @version $Revision: 1.28 $ > -*/ > + * This container acquires the given instance. > + * > + * @see > + * @author Rickard Öberg ([EMAIL PROTECTED]) > + * @author mailto:[EMAIL PROTECTED]";>Marc Fleury > + * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini > + * @version $Revision: 1.28.2.1 $ > + */ >public class EntityInstanceInterceptor >extends AbstractInterceptor >{ > -// Constants - > - > -// Attributes > -protected EntityContainer container; > - > -// Static > - > -// Constructors -- > - > -// Public > -public void setContainer(Container container) > -{ > -this.container = (EntityContainer)container; > -} > - > -public Container getContainer() > -{ > -return container; > -} > - > -// Interceptor implementation -- > -public Object invokeHome(MethodInvocation mi) > -throws Exception > -{ > -// Get context > -EnterpriseContext ctx = >((EntityContainer)getContainer()).getInstancePool().get(); > -mi.setEnterpriseContext(ctx); > - > -// It is a new context for sure so we can lock it > -ctx.lock(); > - > -try > -{ > -// Invoke through interceptors > -return getNext().invokeHome(mi); > -} finally > -{ > -// Always unlock, no matter what > -ctx.unlock(); > - > -// Still free? Not free if create() was called successfully > -if (ctx.getId() == null) > -{ > -container.getInstancePool().free(ctx); > -} > -} > -} > - > -public Object invoke(MethodInvocation mi) > -throws Exception > -{ > -// The id store is a CacheKey in the case of Entity > -CacheKey key = (CacheKey)mi.getId(); > - > -// Get cache > -AbstractInstanceCache cache = >(AbstractInstanceCache)container.getInstanceCache(); > -Sync mutex = (Sync)cache.getLock(key); > - > -EnterpriseContext ctx = null; > - > -try > -{ > -do > + // Constants - > + > + // Attributes > + protected EntityContainer container; > + > + // Static > + > + // Constructors -- > + > + // Public > + public void setContainer(Container container) > + { > + this.container = (EntityContainer)container; > + } > + > + public Container getContainer() > + { > + return contain
Re: [JBoss-dev] EntityInstanceInterceptor change
Did you ever have a chance to look into this at all? I am going a little crazy, since our application is heavily JMS based. The previous version was using SwiftMQ, which I dropped so I could use MDBs. My options for a provider are: JBossMQ - This is what I want to use, but... OpenJMS - Does this even work? Never tried it. SonicMQ - This product angers me more than anything. WebLogic JMS - Only because we have a license for it. These are the only providers that I have found that support ASF & XA. I would really like to continue using JBossMQ, but I can not have it hanging. Is there anything that I could do to help get this fixed (sooner rather than later)? On a related note, is the jbossmq module stable as it is (with its new structure)? --jason On Sat, 14 Jul 2001, Hiram Chirino wrote: > > Jason, > > then I have a feeling that this could have something to do with the changes > that I recently made to the threading model that JBossMQ uses. > > What's the easiest way you think I could reproduce the bug on my systems?? > > Regards, > Hiram > > >From: Jason Dillon <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: <[EMAIL PROTECTED]> > >Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > >Date: Fri, 13 Jul 2001 19:38:42 -0700 (PDT) > > > >Ok, I have verified that if the jbossmq.jar (and jbossmq-client.jar) from > >the 2.1-BETA-Mar-26-2001 build are used that everything works fine. The > >only thing I had to change was the router jboss.jcml changing INVM stuff to > >RMI (which it was not even using) and remove the INVM stuff from > >jbossmq.xml. > > > >I ran the exact same test and it finished flawlessly. > > > >--jason > > > > > >On Fri, 13 Jul 2001, Scott M Stark wrote: > > > > > Do you have the timeout msg that is logged? > > > > > > > > > > > The first odd thing is that when it times out a message is logged, but > >the > > > > thread still hangs. Should it be interrupted or something? > > > > > > > > > > > > > > > > ___ > > > Jboss-development mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > >___ > >Jboss-development mailing list > >[EMAIL PROTECTED] > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] EntityInstanceInterceptor change
I will play with the cvs version and see what happens. On a somewhat related note, are there any plans to change the package name of JBossMQ (as well as JNP) to something within org.jboss ? It looks like jbossmq.org is not even registered, and that jnp.org is taken by some media and marketing firm. How about moving them to org.jboss.mq and org.jboss.naming respectively ? --jason On Tue, 17 Jul 2001, Hiram Chirino wrote: > > Yes, it should be as stable (or a little more). I'll be integrating it back > into jboss soon. > > And I have seen the problems you have talked about with the OIL. I'm going > to have to research that more. > > Oh yeah, MQSeries also supports XA now :) > > Regards, > Hiram > > >From: Jason Dillon <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: <[EMAIL PROTECTED]> > >Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > >Date: Mon, 16 Jul 2001 21:17:50 -0700 (PDT) > > > >Did you ever have a chance to look into this at all? I am going a little > >crazy, since our application is heavily JMS based. The previous version > >was > >using SwiftMQ, which I dropped so I could use MDBs. > > > >My options for a provider are: > > > > JBossMQ - This is what I want to use, but... > > OpenJMS - Does this even work? Never tried it. > > SonicMQ - This product angers me more than anything. > > WebLogic JMS - Only because we have a license for it. > > > >These are the only providers that I have found that support ASF & XA. I > >would really like to continue using JBossMQ, but I can not have it hanging. > > > >Is there anything that I could do to help get this fixed (sooner rather > >than > >later)? > > > >On a related note, is the jbossmq module stable as it is (with its new > >structure)? > > > >--jason > > > > > >On Sat, 14 Jul 2001, Hiram Chirino wrote: > > > > > > > > Jason, > > > > > > then I have a feeling that this could have something to do with the > >changes > > > that I recently made to the threading model that JBossMQ uses. > > > > > > What's the easiest way you think I could reproduce the bug on my > >systems?? > > > > > > Regards, > > > Hiram > > > > > > >From: Jason Dillon <[EMAIL PROTECTED]> > > > >Reply-To: [EMAIL PROTECTED] > > > >To: <[EMAIL PROTECTED]> > > > >Subject: Re: [JBoss-dev] EntityInstanceInterceptor change > > > >Date: Fri, 13 Jul 2001 19:38:42 -0700 (PDT) > > > > > > > >Ok, I have verified that if the jbossmq.jar (and jbossmq-client.jar) > >from > > > >the 2.1-BETA-Mar-26-2001 build are used that everything works fine. > >The > > > >only thing I had to change was the router jboss.jcml changing INVM > >stuff to > > > >RMI (which it was not even using) and remove the INVM stuff from > > > >jbossmq.xml. > > > > > > > >I ran the exact same test and it finished flawlessly. > > > > > > > >--jason > > > > > > > > > > > >On Fri, 13 Jul 2001, Scott M Stark wrote: > > > > > > > > > Do you have the timeout msg that is logged? > > > > > > > > > > > > > > > > > The first odd thing is that when it times out a message is logged, > >but > > > >the > > > > > > thread still hangs. Should it be interrupted or something? > > > > > > > > > > > > > > > > > > > > > > > > > > ___ > > > > > Jboss-development mailing list > > > > > [EMAIL PROTECTED] > > > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > > > > > > > > > >___ > > > >Jboss-development mailing list > > > >[EMAIL PROTECTED] > > > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > _ > > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > > > > ___ > > > Jboss-development mailing list > > > [EMAIL PROTECTED] > > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > > > > >___ > >Jboss-development mailing list > >[EMAIL PROTECTED] > >http://lists.sourceforge.net/lists/listinfo/jboss-development > > _ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] Coding Style
3 spaces. --jason On Thu, 19 Jul 2001, Schaefer, Andreas wrote: > Thanx > > But now I am a little bit more confused. Just to fix this > maybe once and for all: > the classes uses 2 spaces as identation but one of the > latest mails Marc said use 3 spaces !! > > I favor 3 but I can live with any number but we should only > use one. > > Andy > > > -Original Message- > > From: Scott M Stark [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, July 19, 2001 1:39 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [JBoss-dev] Coding Style > > > > > > Its documented in the src/etc/class.java and > > src/etc/interface.java files of > > the jboss cvs module. Feel free to turn it into a page for > > the web site. > > > > - Original Message - > > From: "Schaefer, Andreas" <[EMAIL PROTECTED]> > > To: "jBoss-Dev (E-mail)" <[EMAIL PROTECTED]> > > Sent: Thursday, July 19, 2001 1:20 PM > > Subject: [JBoss-dev] Coding Style > > > > > > > Hi Geeks > > > > > > Due the latest bunch of email I was getting a little > > > bit confused how the actual Coding Style or Guidelines > > > are. Do we have a document/page about this (or shouldn't > > > we have one)? > > > > > > > > > Have fun - Mad Andy / Better Pizza > > > > > > > > ___ > > Jboss-development mailing list > > [EMAIL PROTECTED] > > http://lists.sourceforge.net/lists/listinfo/jboss-development > > > > > ___ > Jboss-development mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-development > ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/util MBeanProxy.java
User: user57 Date: 01/07/19 22:08:56 Modified:src/main/org/jboss/util MBeanProxy.java Log: o cleaned up & added javadoc o added methods that take a MBeanServer o decoding a few more jmx exceptions Revision ChangesPath 1.6 +131 -36 jboss/src/main/org/jboss/util/MBeanProxy.java Index: MBeanProxy.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/MBeanProxy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MBeanProxy.java 2001/06/18 20:01:28 1.5 +++ MBeanProxy.java 2001/07/20 05:08:56 1.6 @@ -6,23 +6,27 @@ */ package org.jboss.util; -import java.io.*; -import java.net.*; import java.lang.reflect.Method; -import javax.management.*; -import javax.management.loading.MLet; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; +import javax.management.MalformedObjectNameException; +import javax.management.MBeanException; +import javax.management.ReflectionException; +import javax.management.RuntimeOperationsException; +import javax.management.RuntimeMBeanException; +import javax.management.RuntimeErrorException; -import org.jboss.logging.Log; import org.jboss.proxy.Proxy; import org.jboss.proxy.InvocationHandler; /** - * + * A factory for producing MBean proxies. * - * @see - * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. - * @version $Revision: 1.5 $ + * @author mailto:[EMAIL PROTECTED]";>Rickard Öberg. + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.6 $ */ public class MBeanProxy implements InvocationHandler @@ -30,60 +34,151 @@ // Constants - // Attributes - ObjectName name; - MBeanServer server; + + /** The server to proxy invoke calls to. */ + private final MBeanServer server; + + /** The name of the object to invoke. */ + private final ObjectName name; // Static - public static Object create(Class intf, String name) + + /** +* Create an MBean proxy. +* +* @param intfThe interface which the proxy will implement. +* @param nameA string used to construct the ObjectName of the +*MBean to proxy to. +* @returnA MBean proxy. +* +* @throws MalformedObjectNameExceptionInvalid object name. +*/ + public static Object create(final Class intf, final String name) + throws MalformedObjectNameException + { + return Proxy.newProxyInstance(intf.getClassLoader(), +new Class[] { intf }, +new MBeanProxy(new ObjectName(name))); + } + + /** +* Create an MBean proxy. +* +* @param intf The interface which the proxy will implement. +* @param name A string used to construct the ObjectName of the +* MBean to proxy to. +* @param serverThe MBeanServer that contains the MBean to proxy to. +* @return A MBean proxy. +* +* @throws MalformedObjectNameExceptionInvalid object name. +*/ + public static Object create(final Class intf, + final String name, + final MBeanServer server) throws MalformedObjectNameException { + return Proxy.newProxyInstance + (intf.getClassLoader(), + new Class[] { intf }, + new MBeanProxy(new ObjectName(name), server)); + } + + /** +* Create an MBean proxy. +* +* @param intfThe interface which the proxy will implement. +* @param nameThe name of the MBean to proxy invocations to. +* @returnA MBean proxy. +*/ + public static Object create(final Class intf, final ObjectName name) + { return Proxy.newProxyInstance(intf.getClassLoader(), - new Class[] { intf }, - new MBeanProxy(name)); +new Class[] { intf }, +new MBeanProxy(name)); } - public static Object create(Class intf, ObjectName name) + /** +* Create an MBean proxy. +* +* @param intf The interface which the proxy will implement. +* @param name The name of the MBean to proxy invocations to. +* @param serverThe MBeanServer that contains the MBean to proxy to. +* @return A MBean p
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/asf StdServerSessionPool.java
User: user57 Date: 01/07/19 22:10:53 Modified:src/main/org/jboss/jms/asf StdServerSessionPool.java Log: o re-indent & javadoc clean up o changed logging to Log4j Revision ChangesPath 1.8 +186 -157 jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java Index: StdServerSessionPool.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- StdServerSessionPool.java 2001/06/27 03:08:21 1.7 +++ StdServerSessionPool.java 2001/07/20 05:10:53 1.8 @@ -34,175 +34,204 @@ import javax.jms.XAQueueSession; import javax.jms.XATopicSession; -import org.jboss.logging.Logger; import EDU.oswego.cs.dl.util.concurrent.PooledExecutor; import EDU.oswego.cs.dl.util.concurrent.Executor; import EDU.oswego.cs.dl.util.concurrent.ThreadFactory; import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer; +import org.apache.log4j.Category; + /** - * StdServerSessionPool.java + * Implementation of ServerSessionPool. * * * Created: Thu Dec 7 17:02:03 2000 * - * @author - * @version + * @author mailto:[EMAIL PROTECTED]";>Peter Antman. + * @version $Revision: 1.8 $ */ - -public class StdServerSessionPool implements ServerSessionPool { - private static final int DEFAULT_POOL_SIZE = 15; - private int poolSize = DEFAULT_POOL_SIZE; - private int ack; - private boolean transacted; - private MessageListener listener; - private Connection con; - - - private Vector sessionPool = new Vector(); - - boolean isTransacted() { - return transacted; - } - - - /** - * Minimal constructor, could also have stuff for pool size - */ - public StdServerSessionPool(Connection con, boolean transacted, int ack, MessageListener listener) throws JMSException{ - this(con,transacted,ack,listener,DEFAULT_POOL_SIZE); - } - public StdServerSessionPool(Connection con, boolean transacted, int ack, MessageListener listener, int maxSession) throws JMSException { - this.con= con; - this.ack= ack; - this.listener= listener; - this.transacted= transacted; - this.poolSize= maxSession; - - executor = new PooledExecutor(poolSize); - executor.setMinimumPoolSize(0); - executor.setKeepAliveTime(1000*30); - executor.waitWhenBlocked(); - executor.setThreadFactory( new ThreadFactory() { - public Thread newThread(Runnable command) { - return new Thread( threadGroup, command, "Thread Pool Worker"); - } - } - ); - +public class StdServerSessionPool + implements ServerSessionPool +{ + private static ThreadGroup threadGroup = + new ThreadGroup("ASF Session Pool Threads"); + private static final int DEFAULT_POOL_SIZE = 15; + + /** Instance logger. */ + private final Category log = Category.getInstance(this.getClass()); + + private int poolSize = DEFAULT_POOL_SIZE; + private int ack; + private boolean transacted; + private MessageListener listener; + private Connection con; + private Vector sessionPool = new Vector(); + private PooledExecutor executor; + + boolean isTransacted() { + return transacted; + } + + /** +* Minimal constructor, could also have stuff for pool size +*/ + public StdServerSessionPool(Connection con, + boolean transacted, + int ack, + MessageListener listener) + throws JMSException + { + this(con,transacted,ack,listener,DEFAULT_POOL_SIZE); + } + + public StdServerSessionPool(Connection con, + boolean transacted, + int ack, + MessageListener listener, + int maxSession) + throws JMSException + { + this.con= con; + this.ack= ack; + this.listener= listener; + this.transacted= transacted; + this.poolSize= maxSession; + + executor = new PooledExecutor(poolSize); + executor.setMinimumPoolSize(0); + executor.setKeepAliveTime(1000*30); + executor.waitWhenBlocked(); + executor.setThreadFactory(new ThreadFactory() { +public Thread newThread(Runnable command) { + return new Thread(threadGroup, command, "Thread Pool Worker"); +} + }); - init(); - Logger.debug("Server Se
[JBoss-dev] Build system; a new hope...
A few weeks ago I mentioned that I was going to write some email about a build system that I had been working on. Unfortunately due to some of the entity locking & jbossmq problems I was unable to focus much time on actually writing that email. Since then I have found that there is always something else todo besides write that mail, so I figure I just have to sit down and do it. A build system should be easy to use. It should also be configurable on a per-user and per-project basis and have a mechanism to group source modules together, produce release archives, make coffee in the morning and take care of you when you get sick. Well, I think I have a suitable solution to *most* of this; I still haven't got the coffee part done yet, and if you are sick enough you might think the build system is taking care of you. Over the years I have been working with build systems, first based on clumsy usage of make, to more advanced usage, then on the ant and now here I am. My first build system (build-foo) was based on something that we used at Mpath Interactive, called build-glue. When I moved over to Ant I renamed it to BuildMagic. Over the last six months I have been learning to adapt to some of the more ridiculous problems created by Ant as well as embracing the elegance that it provides. The drive to redesign BuildMagic was based on its lack of ability to aggregate modules together in a unified, manageable fashion (which I need for open source libraries that I produce, the increasingly complex software modules which I have to deal with at work). Ok enough babel, here is a brief overview: BuildMagic is a set of extension tasks for Ant 1.3 as well as a common configuration and build output structure. There are two major "things" in BuildMagic: Projects and Modules. A project is an aggregation of modules. It controls the configuration and execution of the modules build system. It provides a mechanism to invoke a group of modules and to collect there output to produce a project release. If anyone as played with NetBeans, some of the module configuration inspiration came from looking at there build system in depth. A module is something that contains source files to compile, documents to perform filter substitution on and other such things. The distinction between the two is important. One key feature of BuildMagic is how configuration properties are processed. Ant 1.3 does not currently have any native late binding property; BuildMagic *fixes* this problem. It also provides some logic and looping tasks, but I just implemented those for fun really. * * * I will go in more detail shortly, but for those of you who would like to see it in action you can look at Bliss: http://sourceforge.net/projects/bliss/ cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/bliss login cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/bliss get -r bliss_0_9_1 bliss You can check out the main branch, but it is not guaranteed to compile, due to some re-factoring. export JAVA_HOME=/where/the/jdk/lives cd bliss/build ./build release If all goes well you will end up with a output/bliss-0.9.1-*.jar file under build, which contains the modules api and jar file for the common module. * * * Each project is based in a single root directory (you could probably modify the build files to get around this, but I would not recommend it). Each project looks something like this: project_root/ build/ source1/ source2/ tools/ thirdparty/ project_root, source1, source2 and build are arbitrary. tools contains libraries, scripts and whatever is used by the build system (and only the build system) and thirdparty contains libraries scripts and whatever that is used commonly between all of the source modules. The distinction between tools and thirdparty is subtle, but necessary. Consider a project that used ant 1.3 to build, but requires ant 1.1 to function (for whatever reason that might be). Both the tools and thirdparty directories are laid out like this: / package_name contains no version numbers or vendor names, though I suppose you could encode vendor names if you liked. So for example if a project depends on JMX v1.0ri you would want something like this: thirdparty/jmx/lib thirdparty/jmx/lib/jmxgrinder.jar thirdparty/jmx/lib/jmxri.jar thirdparty/jmx/lib/jmxtools.jar With Bliss I have chosen to exploit the CVSROOT/modules file to build the tools and thirdparty structure. Check out the modules file for a better idea: cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/bliss get -c There are ups and downs to this, one of the downs is that it makes it hard to manage additions and removals of thirdparty modules with branch specs. Though and advantage is that if you have more than one project that depends on a version of a thirdparty library, you only have to update the library once (instead of for each project). Any ways, as long at the name space ends up the same it does not really matter how the files g
[JBoss-dev] .sar, class loaders and depend. libs
Marc, have you done any work on the new loading system with respect to common dependency libraries (for dynamic library reloading... possibly even usage of more than one library version per vm) for the new startup mechanism yet? I remember that you said that was one thing you were interested in. If there was a ServiceClassLoader, which would inspect a the available classes from: 1) The .sar class loader The service archinve classes will override all others (perhaps there is a per service config class loader that preceeds this to allow for per configuration class loading overrides). 2) A dynamic library class loader This is where we plug in a list of other class loaders, which will be the class loaders for a library archive, like ant 1.1 vs. ant 2. This is an odd example, but imagine a service that used ant 1.1 in someway, then a service that required ant 2.0. Both set of classes could be loaded in the same vm at the same time. Why I don't know, but the point is that we could load arbirary versions of dependant libraries into the same vm for services. Could even be used for fast hot swap when versions change. Have both versions of the service in memory and initalized at the same time, then turn off the old one, start the new one. Down time is minimized =) 3) the server class loader This is the basic class loader used to load the core JBoss components. Perhaps this is reloadable? 4) the system class loader 5) the primordial class loader Yada, yada, yada. * * * Just a thought. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] ==>> Tries to get statistics
Why are all of these messages logged with System.out? They are making it very hard to debug other parts of the system. --jason ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra JmsConnectionManager.java
User: user57 Date: 01/07/20 16:04:32 Modified:src/main/org/jboss/jms/ra JmsConnectionManager.java Log: o re-format & cleaned up javadocs Revision ChangesPath 1.3 +32 -24jboss/src/main/org/jboss/jms/ra/JmsConnectionManager.java Index: JmsConnectionManager.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ra/JmsConnectionManager.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JmsConnectionManager.java 2001/06/18 20:01:26 1.2 +++ JmsConnectionManager.java 2001/07/20 23:04:32 1.3 @@ -24,32 +24,40 @@ import javax.resource.spi.ManagedConnection; /** - - The resource adapters own ConnectionManager, used in non managed - environments. - - - Will handle some of the houskeeping an appserver nomaly does. - - + * The resource adapters own ConnectionManager, used in non-managed + * environments. + * + * Will handle some of the houskeeping an appserver nomaly does. * - * Created: Thu Mar 29 16:09:26 2001 + * Created: Thu Mar 29 16:09:26 2001 * * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ - -public class JmsConnectionManager implements ConnectionManager { - -public JmsConnectionManager() { - -} - -public Object allocateConnection(ManagedConnectionFactory mcf, - ConnectionRequestInfo cxRequestInfo) - throws ResourceException{ - ManagedConnection mc = mcf.createManagedConnection(null,cxRequestInfo); - return mc.getConnection(null,cxRequestInfo); +public class JmsConnectionManager + implements ConnectionManager +{ + /** +* Construct a JmsConnectionManager. +*/ + public JmsConnectionManager() { + super(); + } -} -} // JmsConnectionManager + /** +* Allocate a new connection. +* +* @param mcf +* @param cxRequestInfo +* @return A new connection +* +* @throws ResourceException Failed to create connection. +*/ + public Object allocateConnection(ManagedConnectionFactory mcf, +ConnectionRequestInfo cxRequestInfo) + throws ResourceException + { + ManagedConnection mc = mcf.createManagedConnection(null, cxRequestInfo); + return mc.getConnection(null, cxRequestInfo); + } +} ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/asf StdServerSessionPoolFactory.java
User: user57 Date: 01/07/20 19:04:57 Modified:src/main/org/jboss/jms/asf StdServerSessionPoolFactory.java Log: o reformated and mostly documented. Revision ChangesPath 1.4 +62 -19 jboss/src/main/org/jboss/jms/asf/StdServerSessionPoolFactory.java Index: StdServerSessionPoolFactory.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSessionPoolFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- StdServerSessionPoolFactory.java 2001/03/02 14:59:30 1.3 +++ StdServerSessionPoolFactory.java 2001/07/21 02:04:57 1.4 @@ -17,34 +17,77 @@ */ package org.jboss.jms.asf; -import java.util.Hashtable; +import java.io.Serializable; import javax.jms.ServerSessionPool; import javax.jms.MessageListener; import javax.jms.Connection; import javax.jms.JMSException; + /** * StdServerSessionPoolFactory.java * - * * Created: Fri Dec 22 09:47:41 2000 * - * @author Peter Antman - * @version + * @author mailto:[EMAIL PROTECTED]";>Peter Antman. + * @version $Revision: 1.4 $ */ +public class StdServerSessionPoolFactory + implements ServerSessionPoolFactory, Serializable +{ + /** The name of this factory. */ + private String name; + + /** +* Construct a StdServerSessionPoolFactory. +*/ + public StdServerSessionPoolFactory() { + super(); + } + + /** +* Set the name of the factory. +* +* @param nameThe name of the factory. +*/ + public void setName(final String name) { + this.name = name; + } + + /** +* Get the name of the factory. +* +* @returnThe name of the factory. +*/ + public String getName() { + return name; + } -public class StdServerSessionPoolFactory implements ServerSessionPoolFactory, java.io.Serializable { -private Hashtable pools = new Hashtable(); - -private String name; -public StdServerSessionPoolFactory() { - -} -public void setName(String name){this.name = name;} -public String getName(){return name;} - -public ServerSessionPool getServerSessionPool(Connection con, int maxSession, boolean isTransacted, int ack, MessageListener listener) throws JMSException { - ServerSessionPool pool = (ServerSessionPool)new StdServerSessionPool(con, isTransacted, ack, listener,maxSession); - return pool; -} -} // StdServerSessionPoolFactory + /** +* Create a new ServerSessionPool. +* +* @param con +* @param maxSession +* @param isTransacted +* @param ack +* @param listener +* @returnA new pool. +* +* @throws JMSException +*/ + public ServerSessionPool getServerSessionPool(Connection con, + int maxSession, + boolean isTransacted, + int ack, + MessageListener listener) + throws JMSException + { + ServerSessionPool pool = (ServerSessionPool) + new StdServerSessionPool(con, + isTransacted, + ack, + listener, + maxSession); + return pool; + } +} ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/jms JMSContainerInvoker.java
User: user57 Date: 01/07/20 19:08:02 Modified:src/main/org/jboss/ejb/plugins/jms JMSContainerInvoker.java Log: o Using ConnectionFactoryHelper to create connections o Factored out some of the common Queue & Topic initalization so they can both use the same code. Note there is still some work that could be done here to clean things up. o Documented things a bit more. Revision ChangesPath 1.18 +253 -177 jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java Index: JMSContainerInvoker.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JMSContainerInvoker.java 2001/07/09 21:14:28 1.17 +++ JMSContainerInvoker.java 2001/07/21 02:08:01 1.18 @@ -35,6 +35,7 @@ import org.apache.log4j.Category; +import org.jboss.jms.ConnectionFactoryHelper; import org.jboss.ejb.MethodInvocation; import org.jboss.ejb.Container; import org.jboss.ejb.ContainerInvokerContainer; @@ -59,7 +60,7 @@ * @author mailto:[EMAIL PROTECTED]";>Sebastien Alborini * @author mailto:[EMAIL PROTECTED]";>Marc Fleury * @author mailto:[EMAIL PROTECTED]";>Jason Dillon - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ public class JMSContainerInvoker implements ContainerInvoker, XmlLoadable @@ -108,20 +109,17 @@ // Public - public void setOptimized(boolean optimize) - { + public void setOptimized(final boolean optimize) { log.debug("Container Invoker optimize set to " + optimize); this.optimize = optimize; } - public boolean isOptimized() - { + public boolean isOptimized() { log.debug("Optimize in action: " + optimize); return optimize; } - public EJBMetaData getEJBMetaData() - { + public EJBMetaData getEJBMetaData() { throw new Error("Not valid for MessageDriven beans"); } @@ -171,7 +169,12 @@ } // ContainerService implementation --- - + + /** +* Set the container for which this is an invoker to. +* +* @param containerThe container for which this is an invoker to. +*/ public void setContainer(final Container container) { this.container = container; @@ -180,6 +183,8 @@ /** * Return the JMSProviderAdapter that should be used. +* +* @returnThe JMSProviderAdapter to use. */ protected JMSProviderAdapter getJMSProviderAdapter() throws NamingException @@ -195,23 +200,160 @@ } /** -* Return the ServerSessionPoolFactory that should be used. +* Create a new connection from the given factory. +* +* @param factory An object that implements QueueConnectionFactory, +*XAQueueConnectionFactory, TopicConnectionFactory or +*XATopicConnectionFactory. +* @param usernameThe username to use or null for no user. +* @param passwordThe password for the given username or null if no +* @returnA new connection from the given factory. +* +* @throws JMSExceptionFailed to create connection. */ - protected ServerSessionPoolFactory getServerSessionPoolFactory() - throws NamingException + protected Connection createConnection(final Object factory, + final String username, + final String password) + throws JMSException + { + log.debug("attempting to create connection from factory: " + factory); + connection = ConnectionFactoryHelper.createConnection + (factory, username, password); + log.debug("created connection: " + connection); + + return connection; + } + + /** +* Parse the JNDI suffix from the given JNDI name. +* +* @param jndinameThe JNDI name used to lookup the destination. +* @param defaultSuffix The default suffix to use if parsing fails. +* @returnThe parsed suffix or the defaultSuffix +*/ + protected String parseJndiSuffix(final String jndiname, +final String defautSuffix) + { + // jndiSuffix is merely the name that the user has given the MDB. + // since the jndi name contains the message type I have to split + // at the "/" if there is no slash then I use the entire jndi name... + String jndiSuffix = ""; + if (jndiname !
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms ConnectionFactoryHelper.java
User: user57 Date: 01/07/20 19:05:47 Added: src/main/org/jboss/jms ConnectionFactoryHelper.java Log: o Adding a helper class which creates connections from a connection factory, prefering xa connections if possible. Revision ChangesPath 1.1 jboss/src/main/org/jboss/jms/ConnectionFactoryHelper.java Index: ConnectionFactoryHelper.java === /* * JBoss, the OpenSource EJB server * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.jms; import javax.jms.JMSException; import javax.jms.Connection; import javax.jms.QueueConnectionFactory; import javax.jms.XAQueueConnectionFactory; import javax.jms.TopicConnectionFactory; import javax.jms.XATopicConnectionFactory; import org.apache.log4j.Category; /** * A helper for creating connections from jms connection factories. * * @author mailto:[EMAIL PROTECTED]";>Jason Dillon * @version $Revision: 1.1 $ */ public class ConnectionFactoryHelper { /** Class logger. */ private static Category log = Category.getInstance(ConnectionFactoryHelper.class); /** * Create a connection from the given factory. An XA connection will * be created if possible. * * @param factory An object that implements QueueConnectionFactory, *XAQueueConnectionFactory, TopicConnectionFactory or *XATopicConnectionFactory. * @param usernameThe username to use or null for no user. * @param passwordThe password for the given username or null if no *username was specified. * @returnA connection. * * @throws JMSExceptionFailed to create connection. * @throws IllegalArgumentExceptionFactory is null or invalid. */ public static Connection createConnection(final Object factory, final String username, final String password) throws JMSException { if (factory == null) throw new IllegalArgumentException("factory is null"); Connection connection; if (factory instanceof QueueConnectionFactory) { QueueConnectionFactory qFactory = (QueueConnectionFactory)factory; if (username != null) { connection = qFactory.createQueueConnection(username, password); } else { connection = qFactory.createQueueConnection(); } log.debug("created QueueConnection: " + connection); } else if (factory instanceof XAQueueConnectionFactory) { XAQueueConnectionFactory qFactory = (XAQueueConnectionFactory)factory; if (username != null) { connection = qFactory.createXAQueueConnection(username, password); } else { connection = qFactory.createXAQueueConnection(); } log.debug("created XAQueueConnection: " + connection); } else if (factory instanceof TopicConnectionFactory) { TopicConnectionFactory tFactory = (TopicConnectionFactory)factory; if (username != null) { connection = tFactory.createTopicConnection(username, password); } else { connection = tFactory.createTopicConnection(); } log.debug("created TopicConnection: " + connection); } else if (factory instanceof XATopicConnectionFactory) { XATopicConnectionFactory tFactory = (XATopicConnectionFactory)factory; if (username != null) { connection = tFactory.createXATopicConnection(username, password); } else { connection = tFactory.createXATopicConnection(); } log.debug("created XATopicConnection: " + connection); } else { throw new IllegalArgumentException("factory is invalid"); } return connection; } /** * Create a connection from the given factory. An XA connection will * be created if possible. * * @param factory An object that implements QueueConnectionFactory, *XAQueueConnectionFactory, TopicConnectionFactory or *XATopicConnectionFactory. * @returnA connection. * * @throws JMSExceptionFailed to create connection. * @throws IllegalArgumentExceptionFactory is null or invalid. */ public static Connection createConnection(final Object factory) throws JMS
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra JmsManagedConnection.java
Should we register an + *ExceptionListener and mark al handles as errounous? And then let them + *send the event and throw an exception? * - * Created: Tue Apr 10 13:09:45 2001 + * Created: Tue Apr 10 13:09:45 2001 * * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @version $Revision: 1.4 $ + * @author mailto:[EMAIL PROTECTED]";>Jason Dillon + * @version $Revision: 1.5 $ */ public class JmsManagedConnection implements ManagedConnection { private JmsManagedConnectionFactory mcf; private JmsConnectionRequestInfo info; - private String user = null; - private String pwd = null; - - private boolean isDestroyed = false; + private String user; // = null; + private String pwd; // = null; + private boolean isDestroyed; // = false; // Physical JMS connection stuff private Connection con; - //private TopicConnection topicConnection; private TopicSession topicSession; private XATopicSession xaTopicSession; - //private QueueConnection queueConnection; private QueueSession queueSession; private XAQueueSession xaQueueSession; private XAResource xaResource; - // private boolean isTopic = true; - private boolean xaTransacted = true; + private boolean xaTransacted; // = false; - // Should we have one for each connection - private PrintWriter logWriter = null; + /** Should we have one for each connection */ + private PrintWriter logWriter; // = null; private JmsLogger logger = new JmsLogger(); - // Holds all current JmsSession handles - private Set handles = new HashSet(); + /** Holds all current JmsSession handles. */ + private Set handles = new HashSet(); - // The event listeners - Vector listeners = new Vector(); - - public JmsManagedConnection(JmsManagedConnectionFactory mcf, - ConnectionRequestInfo info, - String user, - String pwd) throws ResourceException + /** The event listeners */ + private Vector listeners = new Vector(); + + /** +* Create a JmsManagedConnection. +* +* @param mcf +* @param info +* @param user +* @param pwd +* +* @throws ResourceException +*/ + public JmsManagedConnection(final JmsManagedConnectionFactory mcf, + final ConnectionRequestInfo info, + final String user, + final String pwd) + throws ResourceException { this.mcf = mcf; this.info = (JmsConnectionRequestInfo)info; this.user = user; this.pwd = pwd; - setUp(); - + setup(); } // ManagedConnection API @@ -165,69 +173,102 @@ /** * Get the physical connection handler. * -* This bummer will be called in two situations. -* 1. When a new mc has bean created and a connection is needed -* 2. When an mc has been fetched from the pool (returned in match*) -* -* It may also be called multiple time without a cleanup, to support -* connection sharing - */ - public Object getConnection(Subject subject, - ConnectionRequestInfo info) +* This bummer will be called in two situations: +* +* When a new mc has bean created and a connection is needed +* When an mc has been fetched from the pool (returned in match*) +* +* +* It may also be called multiple time without a cleanup, to support +*connection sharing. +* +* @param subject +* @param info +* @return A new connection object. +* +* @throws ResourceException +*/ + public Object getConnection(final Subject subject, + final ConnectionRequestInfo info) throws ResourceException { // Check user first JmsCred cred = JmsCred.getJmsCred(mcf,subject,info); // Null users are allowed! - if (user != null && !user.equals(cred.name) ) - throw new SecurityException("Password credentials not the same, reauthentication not allowed"); - if (cred.name != null && user == null) - throw new SecurityException("Password credentials not the same, reauthentication not allowed"); + if (user != null && !user.equals(cred.name)) { + throw new SecurityException +("Password credentials not the same, reauthentication not allowed"); + } + if (cred.name != null && user == null) { + throw new SecurityException +("Password credentials not the same, reauthentication not allowed&quo
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra JmsSessionFactoryImpl.java
User: user57 Date: 01/07/20 19:12:04 Modified:src/main/org/jboss/jms/ra JmsSessionFactoryImpl.java Log: o reformat Revision ChangesPath 1.3 +185 -163 jboss/src/main/org/jboss/jms/ra/JmsSessionFactoryImpl.java Index: JmsSessionFactoryImpl.java === RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ra/JmsSessionFactoryImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JmsSessionFactoryImpl.java2001/06/18 20:01:26 1.2 +++ JmsSessionFactoryImpl.java2001/07/21 02:12:04 1.3 @@ -27,8 +27,6 @@ import javax.resource.spi.ConnectionManager; import javax.resource.spi.ConnectionRequestInfo; - - import javax.jms.JMSException; import javax.jms.ConnectionConsumer; import javax.jms.ServerSessionPool; @@ -40,173 +38,197 @@ import javax.jms.ConnectionMetaData; import org.jboss.jms.ra.client.JmsSessionFactory; + /** * JmsSessionFactoryImpl.java * + * Created: Thu Mar 29 15:36:51 2001 * - * Created: Thu Mar 29 15:36:51 2001 - * * @author mailto:[EMAIL PROTECTED]";>Peter Antman. - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ - -public class JmsSessionFactoryImpl implements JmsSessionFactory,Serializable, Referenceable { -private static final String ISE = "This method is not applicatable in JMS resource adapter"; - -private Reference reference; - -// Used from JmsConnectionFactory -private String userName = null; -private String password = null; -private Boolean isTopic = null; - -/** - * JmsRa own factory - */ -private ManagedConnectionFactory mcf; - -/** - * Hook to the appserver - */ -private ConnectionManager cm; - - -public JmsSessionFactoryImpl(ManagedConnectionFactory mcf, - ConnectionManager cm) -{ - this.mcf = mcf; - this.cm = cm; -if (cm == null) { - // This is standalone usage, no appserver -this.cm = new JmsConnectionManager(); -} else { -this.cm = cm; -} - -} - -public void setReference(Reference reference) { - this.reference = reference; -} - -public Reference getReference() { -return reference; -} - -// --- API for JmsConnectionFactoryImpl -public void setUserName(String name) -{ - userName = name; -} - -public void setPassword(String password) -{ - this.password = password; -} - -public void isTopic(Boolean isTopic) { - this.isTopic = isTopic; -} -// QueueConnection --- -public QueueSession createQueueSession(boolean transacted, -int acknowledgeMode) - throws JMSException -{ - try { - if(isTopic != null && isTopic == Boolean.TRUE) - throw new IllegalStateException("Cant get a queue session from a topic connection"); - - JmsConnectionRequestInfo info = - new JmsConnectionRequestInfo(transacted,acknowledgeMode,false); - info.setUserName(userName); - info.setPassword(password); +public class JmsSessionFactoryImpl + implements JmsSessionFactory, Serializable, Referenceable +{ + private static final String ISE = + "This method is not applicatable in JMS resource adapter"; + + private Reference reference; + + // Used from JmsConnectionFactory + private String userName; // = null; + private String password; // = null; + private Boolean isTopic; // = null; + + /** JmsRa own factory */ + private ManagedConnectionFactory mcf; + + /** Hook to the appserver */ + private ConnectionManager cm; + + public JmsSessionFactoryImpl(final ManagedConnectionFactory mcf, +final ConnectionManager cm) + { + this.mcf = mcf; + this.cm = cm; + + if (cm == null) { + // This is standalone usage, no appserver + this.cm = new JmsConnectionManager(); + } + else { + this.cm = cm; + } + } + + public void setReference(final Reference reference) { + this.reference = reference; + } + + public Reference getReference() { + return reference; + } + + // --- API for JmsConnectionFactoryImpl + + public void setUserName(final String name) + { + userName = name; + } + + public void setPassword(final String password) + { + this.password = password; + } + + public void isTopic(final Boolean isTopic) { + this.isTopic = isTopic; + } + + // Queu
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms package.html
User: user57 Date: 01/07/20 19:17:21 Added: src/main/org/jboss/jms package.html Log: o adding basic package documentation files. Revision ChangesPath 1.1 jboss/src/main/org/jboss/jms/package.html Index: package.html === Provides support for the Java Message Service (JMS). Package Specification Not Available Related Documentation Not Available Package Status STABLE ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/ra package.html
User: user57 Date: 01/07/20 19:17:21 Added: src/main/org/jboss/jms/ra package.html Log: o adding basic package documentation files. Revision ChangesPath 1.1 jboss/src/main/org/jboss/jms/ra/package.html Index: package.html === Provides an EJB resource adapter for JMS. Package Specification Not Available Related Documentation Not Available Package Status STABLE ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/jndi package.html
User: user57 Date: 01/07/20 19:17:21 Added: src/main/org/jboss/jms/jndi package.html Log: o adding basic package documentation files. Revision ChangesPath 1.1 jboss/src/main/org/jboss/jms/jndi/package.html Index: package.html === JNDI abstractions to integrate JMS providers. Package Specification Not Available Related Documentation Not Available Package Status STABLE ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jboss/src/main/org/jboss/jms/asf package.html
User: user57 Date: 01/07/20 19:17:21 Added: src/main/org/jboss/jms/asf package.html Log: o adding basic package documentation files. Revision ChangesPath 1.1 jboss/src/main/org/jboss/jms/asf/package.html Index: package.html === Provides an implementation of the Application Server Facilities (ASF). Package Specification Not Available Related Documentation Not Available Package Status STABLE ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development