Patches item #444219, was opened at 2001-07-24 12:16
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=444219&group_id=22866

Category: JBossCX
Group: v2.5 Rabbit Hole (unstable)
Status: Open
Resolution: None
Priority: 5
Submitted By: David Jencks (d_jencks)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can't add connection factories after rar

Initial Comment:
The current RARDeployer/ConnectionFactoryLoader assumes
that the connection factories are all loaded and
started before the RARDeployer deploys the rar's used
by the connection factory loaders.  This means you
can't add more connection factories later.  The patch
below fixes this by implementing startService on
ConnectionFactoryLoader to check if the needed rar has
been deployed.  If so, it immediately loads the
connection factory, instead of waiting for rar
deployment notification... which will never come.

If requested , I will supply a test class for this change.

[EMAIL PROTECTED]

------------------PATCH----------

Index: resource/ConnectionFactoryLoader.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java,v
retrieving revision 1.4
diff -r1.4 ConnectionFactoryLoader.java
168a169,228
>    //added to allow adding ConnectionFactories after
rar is deployed.
>    protected void startService()
>       throws Exception
>    {
>       if (cfs.get(factoryName) == null) {
>          if
(server.isRegistered(rarDeployerObjectName)) {
>             Object[] args = new Object[] {
resourceAdapterName };
>             String[] sig = new String[] {
"java.lang.String" };
>             RARMetaData rmd =
(RARMetaData)server.invoke(rarDeployerObjectName,
"getMetaData", args, sig);
>             if (rmd != null) {
>                loadConnectionFactory(rmd);
>             }
>          }
>       }
> 
>    }
>    
>    protected void stopService()
>    {
>       if (cfs.get(factoryName) != null) {
>          try {
>             if
(server.isRegistered(rarDeployerObjectName)) {
>                Object[] args = new Object[] {
resourceAdapterName };
>                String[] sig = new String[] {
"java.lang.String" };
>                RARMetaData rmd =
(RARMetaData)server.invoke(rarDeployerObjectName,
"getMetaData", args, sig);
>                if (rmd != null) {
>                   unloadConnectionFactory(rmd);
>                }
>             }
>          }
>          catch (Exception e) {
>              log.error("problem stopping
ConnectionFactoryLoader service: " + e);
>          }
>       }
> 
>    }
>       
>    protected void destroyService()
>    {
>       resourceAdapterName = null;
>       factoryName = null;
>       properties = null;
>       rarDeployerName = null;
>       tmName = null;
>       cmfName = null;
>       cmProps = null;
> 
>    // Principal mapping parameters
>       princMapClass = null;
>       princMapProps = null;
> 
>       rarDeployerObjectName = null;
> 
>    /** The JNDI name to which this connection factory
is bound */
>       bindName = null;
> 
>       cm = null;
> 
> 
>    }
Index: resource/RARDeployer.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java,v
retrieving revision 1.3
diff -r1.3 RARDeployer.java
88a89,101
>     public RARMetaData getMetaData(String
resourceAdapterName) {
>        Collection dis = getDeployments().values();
>        Iterator i = dis.iterator();
>        while (i.hasNext()) {
>           DeploymentInfo di = (DeploymentInfo)i.next();
>           if
(di.metadata.getDisplayName().equals(resourceAdapterName))
{
>              return di.metadata;
>           }
>        }
>        return null;
>     }
> 
> 
Index: resource/RARDeployerMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbosscx/src/main/org/jboss/resource/RARDeployerMBean.java,v
retrieving revision 1.2
diff -r1.2 RARDeployerMBean.java
27c27
< //     public RARMetaData getMetaData(String
resourceAdapterName);
---
>    public RARMetaData getMetaData(String
resourceAdapterName);
Index: DeployerMBeanSupport.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/deployment/DeployerMBeanSupport.java,v
retrieving revision 1.2
diff -r1.2 DeployerMBeanSupport.java
155a156,164
>     /**
>      * so why can't subclasses find who's deployed?
>      */
>    protected Map getDeployments() {
>       synchronized(deployments) {
>          return (Map)((HashMap)deployments).clone();
>       }
>    }       
> 


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=444219&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to