geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/reference ReferenceableManagerImpl.java
Date Thu, 27 May 2004 15:46:54 GMT
gdamour     2004/05/27 08:46:54

  Modified:    sandbox/messaging/src/java/org/apache/geronimo/messaging/admin/deployment
                        AdminServer.java ManagedServer.java
               sandbox/messaging/src/java/org/apache/geronimo/messaging/io
                        StreamManagerImpl.java
               sandbox/messaging/src/java/org/apache/geronimo/messaging/reference
                        ReferenceableManagerImpl.java
  Log:
  When these EndPoints are started, adds their ReplacerResolvers to the
  ReplacerResolver of the hosting Node.
  Conversely, when they are stopped or failed, one sets them offline.
  
  Revision  Changes    Path
  1.2       +22 -2     incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/admin/deployment/AdminServer.java
  
  Index: AdminServer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/admin/deployment/AdminServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdminServer.java	27 May 2004 14:45:59 -0000	1.1
  +++ AdminServer.java	27 May 2004 15:46:54 -0000	1.2
  @@ -42,9 +42,11 @@
   import org.apache.geronimo.deployment.plugin.DeploymentServer;
   import org.apache.geronimo.deployment.plugin.FailedProgressObject;
   import org.apache.geronimo.deployment.plugin.TargetImpl;
  +import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.messaging.AbstractEndPoint;
   import org.apache.geronimo.messaging.Node;
   import org.apache.geronimo.messaging.NodeInfo;
  +import org.apache.geronimo.messaging.io.ReplacerResolver;
   import org.apache.geronimo.messaging.proxy.EndPointProxyInfo;
   import org.apache.xmlbeans.XmlObject;
   
  @@ -71,6 +73,8 @@
        */
       private final Map nameToInfo;
       
  +    private final ReplacerResolver replacerResolver;
  +    
       /**
        * Creates an administration server mounted by the specified node and
        * having the provided identifier. 
  @@ -81,7 +85,7 @@
       public AdminServer(Node aNode, Object anID) {
           super(aNode, anID);
           
  -        node.getReplacerResolver().append(new DeploymentReplacerResolver());
  +        replacerResolver = new DeploymentReplacerResolver();
           
           nameToInfo = new HashMap();
           NodeInfo[] nodes =
  @@ -97,6 +101,22 @@
               info.target = new TargetImpl(nodeInfo.getName(), null);
               nameToInfo.put(nodeInfo.getName(), info);
           }
  +    }
  +    
  +    public void doStart() throws WaitingException, Exception {
  +        super.doStart();
  +        replacerResolver.online();
  +        node.getReplacerResolver().append(replacerResolver);
  +    }
  +    
  +    public void doStop() throws WaitingException, Exception {
  +        super.doStop();
  +        replacerResolver.offline();
  +    }
  +    
  +    public void doFail() {
  +        super.doFail();
  +        replacerResolver.offline();
       }
       
       public boolean isLocal() {
  
  
  
  1.2       +22 -2     incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/admin/deployment/ManagedServer.java
  
  Index: ManagedServer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/admin/deployment/ManagedServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ManagedServer.java	27 May 2004 14:45:59 -0000	1.1
  +++ ManagedServer.java	27 May 2004 15:46:54 -0000	1.2
  @@ -39,11 +39,13 @@
   import org.apache.geronimo.deployment.plugin.local.DistributeCommand;
   import org.apache.geronimo.deployment.plugin.local.StartCommand;
   import org.apache.geronimo.deployment.plugin.local.StopCommand;
  +import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.kernel.Kernel;
   import org.apache.geronimo.kernel.KernelMBean;
   import org.apache.geronimo.kernel.config.ConfigurationStore;
   import org.apache.geronimo.messaging.AbstractEndPoint;
   import org.apache.geronimo.messaging.Node;
  +import org.apache.geronimo.messaging.io.ReplacerResolver;
   import org.apache.geronimo.messaging.reference.ReferenceableEnhancer;
   import org.apache.xmlbeans.SchemaTypeLoader;
   import org.apache.xmlbeans.XmlException;
  @@ -74,6 +76,8 @@
       private final ConfigurationStore store;
       private final Kernel kernel;
       
  +    private final ReplacerResolver replacerResolver;
  +    
       /**
        * Creates a managed deployment server for the specified node.
        * 
  @@ -97,7 +101,23 @@
           // Should be a KernelMBean
           kernel = (Kernel) aKernel;
           
  -        node.getReplacerResolver().append(new DeploymentReplacerResolver());
  +        replacerResolver = new DeploymentReplacerResolver();
  +    }
  +    
  +    public void doStart() throws WaitingException, Exception {
  +        super.doStart();
  +        replacerResolver.online();
  +        node.getReplacerResolver().append(replacerResolver);
  +    }
  +    
  +    public void doStop() throws WaitingException, Exception {
  +        super.doStop();
  +        replacerResolver.offline();
  +    }
  +    
  +    public void doFail() {
  +        super.doFail();
  +        replacerResolver.offline();
       }
       
       public ProgressObject distribute(
  
  
  
  1.2       +23 -3     incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/io/StreamManagerImpl.java
  
  Index: StreamManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/io/StreamManagerImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StreamManagerImpl.java	11 May 2004 12:06:41 -0000	1.1
  +++ StreamManagerImpl.java	27 May 2004 15:46:54 -0000	1.2
  @@ -25,6 +25,7 @@
   import java.util.HashMap;
   import java.util.Map;
   
  +import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.messaging.AbstractEndPoint;
   import org.apache.geronimo.messaging.EndPoint;
   import org.apache.geronimo.messaging.Node;
  @@ -66,6 +67,8 @@
        */
       private final Map inputStreams;
   
  +    private final ReplacerResolver replacerResolver;
  +    
       /**
        * Creates a manager owned by the specified node.
        * 
  @@ -78,7 +81,24 @@
           }
           owningNode = aNode.getNodeInfo();
           inputStreams = new HashMap();
  -        aNode.getReplacerResolver().append(new InputStreamReplacerResolver());
  +        
  +        replacerResolver = new InputStreamReplacerResolver();
  +    }
  +    
  +    public void doStart() throws WaitingException, Exception {
  +        super.doStart();
  +        replacerResolver.online();
  +        node.getReplacerResolver().append(replacerResolver);
  +    }
  +    
  +    public void doStop() throws WaitingException, Exception {
  +        super.doStop();
  +        replacerResolver.offline();
  +    }
  +    
  +    public void doFail() {
  +        super.doFail();
  +        replacerResolver.offline();
       }
       
       public Object register(InputStream anIn) {
  
  
  
  1.3       +22 -3     incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/reference/ReferenceableManagerImpl.java
  
  Index: ReferenceableManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/sandbox/messaging/src/java/org/apache/geronimo/messaging/reference/ReferenceableManagerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ReferenceableManagerImpl.java	24 May 2004 13:02:55 -0000	1.2
  +++ ReferenceableManagerImpl.java	27 May 2004 15:46:54 -0000	1.3
  @@ -21,6 +21,7 @@
   import java.util.IdentityHashMap;
   import java.util.Map;
   
  +import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.messaging.AbstractEndPoint;
   import org.apache.geronimo.messaging.Msg;
   import org.apache.geronimo.messaging.Node;
  @@ -28,6 +29,7 @@
   import org.apache.geronimo.messaging.Request;
   import org.apache.geronimo.messaging.Result;
   import org.apache.geronimo.messaging.interceptors.MsgOutInterceptor;
  +import org.apache.geronimo.messaging.io.ReplacerResolver;
   
   /**
    * ReferenceableManager implementation.
  @@ -56,6 +58,8 @@
        */
       private final IdentityHashMap referenceableToID;
       
  +    private final ReplacerResolver replacerResolver;
  +    
       /**
        * Creates a manager mounted by the specified node and having the specified
        * identifier.
  @@ -69,10 +73,25 @@
           idToReferenceable = new HashMap();
           referenceableToID = new IdentityHashMap();
           
  -        // Adds the ReferenceReplacerResolver to the current chain.
  -        node.getReplacerResolver().append(new ReferenceReplacerResolver(this));
  +        replacerResolver = new ReferenceReplacerResolver(this);
       }
   
  +    public void doStart() throws WaitingException, Exception {
  +        super.doStart();
  +        replacerResolver.online();
  +        node.getReplacerResolver().append(replacerResolver);
  +    }
  +    
  +    public void doStop() throws WaitingException, Exception {
  +        super.doStop();
  +        replacerResolver.offline();
  +    }
  +    
  +    public void doFail() {
  +        super.doFail();
  +        replacerResolver.offline();
  +    }
  +    
       public Object factoryProxy(ReferenceableInfo aReferenceInfo) {
           NodeInfo hostingNode = aReferenceInfo.getHostingNode();
           Object endPointID = aReferenceInfo.getID();
  
  
  

Mime
View raw message