Examples of CreateConnectionResult


Examples of org.jboss.jms.delegate.CreateConnectionResult

   // Public ---------------------------------------------------------------------------------------

   public Object handleCreateConnectionDelegate(Invocation inv) throws Throwable
   {
      CreateConnectionResult res = (CreateConnectionResult)inv.invokeNext();

      ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)res.getDelegate();

      if (connectionDelegate != null && connectionDelegate.getState() == null)
      {
         // no state set yet, initialize and configure it
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

     
      byte v = version.getProviderIncrementingVersion();
                      
      JMSRemotingConnection remotingConnection = null;
     
      CreateConnectionResult res;
     
      try
      {        
         remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing, strictTck, sendAcksAsync);
        
         remotingConnection.start();
  
         Client client = remotingConnection.getRemotingClient();
        
         String remotingSessionId = client.getSessionId();
        
         String clientVMId = JMSClientVMIdentifier.instance;
           
         ConnectionFactoryCreateConnectionDelegateRequest req =
            new ConnectionFactoryCreateConnectionDelegateRequest(id, v,
                                                                 remotingSessionId, clientVMId,
                                                                 username, password, failedNodeID);
          
         ResponseSupport rs = (ResponseSupport)client.invoke(req, null);
        
         res = (CreateConnectionResult)rs.getResponse();
      }
      catch (Throwable t)
      {
         //If we were invoking createConnectionDelegate and failure occurs then we need to clear
         // up the JMSRemotingConnection

         if (remotingConnection != null)
         {
            try
            {
               remotingConnection.stop();
            }
            catch (Throwable ignore)
            {
            }
         }
        
         throw handleThrowable(t);
      }
        
      ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)res.getDelegate();
     
      if (connectionDelegate != null)
      {
         connectionDelegate.setRemotingConnection(remotingConnection);
        
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

            ClientConnectionDelegate cd =
               createConnectionDelegateInternal(username, password, failedNodeID,
                                                remotingSessionID, clientVMID,
                                                versionToUse,
                                                callbackHandler);
            return new CreateConnectionResult(cd);
         }
         else
         {
            log.trace(this + " received client-side failover request. Creating failover "+
               "connection to replace connection to failed node " + failedNodeID);

            // Wait for server side failover to complete
            int failoverNodeID = serverPeer.getFailoverWaiter().waitForFailover(failedNodeID);
           
            if (failoverNodeID == -1 || failoverNodeID != serverPeer.getServerPeerID())
            {
               log.trace(this + " realized that we are on the wrong node or no failover has occured");
               return new CreateConnectionResult(failoverNodeID);
            }
            else
            {
               log.trace(this + " received notification that server-side failover completed, " +
                  "creating connection delegate ...");
               ClientConnectionDelegate cd =
                  createConnectionDelegateInternal(username, password, failedNodeID,
                                                   remotingSessionID, clientVMID,
                                                   versionToUse,
                                                   callbackHandler);
               return new CreateConnectionResult(cd);
            }
         }
      }
      catch (Throwable t)
      {
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/*  73 */   private boolean trace = log.isTraceEnabled();
/*     */
/*     */   public Object handleCreateConnectionDelegate(Invocation inv)
/*     */     throws Throwable
/*     */   {
/*  83 */     CreateConnectionResult res = (CreateConnectionResult)inv.invokeNext();
/*     */
/*  85 */     ClientConnectionDelegate connectionDelegate = res.getDelegate();
/*     */
/*  87 */     if ((connectionDelegate != null) && (connectionDelegate.getState() == null))
/*     */     {
/*  91 */       if (this.trace) log.trace(connectionDelegate + " not configured, configuring ...");
/*     */
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/*     */     {
/* 159 */       if (failedNodeID == -1)
/*     */       {
/* 162 */         ClientConnectionDelegate cd = createConnectionDelegateInternal(username, password, failedNodeID, remotingSessionID, clientVMID, versionToUse, callbackHandler);
/*     */
/* 167 */         return new CreateConnectionResult(cd);
/*     */       }
/*     */
/* 171 */       log.trace(this + " received client-side failover request. Creating failover " + "connection to replace connection to failed node " + failedNodeID);
/*     */
/* 175 */       int failoverNodeID = this.serverPeer.getFailoverWaiter().waitForFailover(failedNodeID);
/*     */
/* 177 */       if ((failoverNodeID == -1) || (failoverNodeID != this.serverPeer.getServerPeerID()))
/*     */       {
/* 179 */         log.trace(this + " realized that we are on the wrong node or no failover has occured");
/* 180 */         return new CreateConnectionResult(failoverNodeID);
/*     */       }
/*     */
/* 184 */       log.trace(this + " received notification that server-side failover completed, " + "creating connection delegate ...");
/*     */
/* 186 */       ClientConnectionDelegate cd = createConnectionDelegateInternal(username, password, failedNodeID, remotingSessionID, clientVMID, versionToUse, callbackHandler);
/*     */
/* 191 */       return new CreateConnectionResult(cd);
/*     */     }
/*     */     catch (Throwable t)
/*     */     {
/*     */     }
/*     */
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/*  86 */     if (advised == null)
/*     */     {
/*  88 */       throw new IllegalStateException("Cannot find object in dispatcher with id " + this.objectId);
/*     */     }
/*     */
/*  91 */     CreateConnectionResult del = advised.createConnectionDelegate(this.username, this.password, this.failedNodeId, getRemotingSessionID(), getClientVMID(), this.version, this.callbackHandler);
/*     */
/*  96 */     return new ConnectionFactoryCreateConnectionDelegateResponse(del);
/*     */   }
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/* 64 */     os.flush();
/*    */   }
/*    */
/*    */   public void read(DataInputStream is) throws Exception
/*    */   {
/* 69 */     this.res = new CreateConnectionResult();
/*    */
/* 71 */     this.res.read(is);
/*    */   }
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/* 197 */       String msg = "Failed to download and/or install client side AOP stack";
/* 198 */       log.error("Failed to download and/or install client side AOP stack", e);
/* 199 */       throw new RuntimeException("Failed to download and/or install client side AOP stack", e);
/*     */     }
/*     */
/* 205 */     CreateConnectionResult res = this.delegate.createConnectionDelegate(username, password, -1);
/*     */
/* 207 */     return new JBossConnection(res.getDelegate(), type);
/*     */   }
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/* 142 */     Version version = ClientConnectionFactoryDelegate.getVersionToUse(this.jdField_serverVersion_of_type_OrgJbossMessagingUtilVersion);
/*     */
/* 144 */     byte v = version.getProviderIncrementingVersion();
/*     */
/* 146 */     JMSRemotingConnection remotingConnection = null;
/*     */     CreateConnectionResult res;
/*     */     try
/*     */     {
/* 152 */       remotingConnection = new JMSRemotingConnection(this.serverLocatorURI, this.clientPing, this.strictTck);
/*     */
/* 154 */       remotingConnection.start();
/*     */
/* 156 */       Client client = remotingConnection.getRemotingClient();
/*     */
/* 158 */       String remotingSessionId = client.getSessionId();
/*     */
/* 160 */       String clientVMId = JMSClientVMIdentifier.instance;
/*     */
/* 162 */       ConnectionFactoryCreateConnectionDelegateRequest req = new ConnectionFactoryCreateConnectionDelegateRequest(this.jdField_id_of_type_JavaLangString, v, remotingSessionId, clientVMId, username, password, failedNodeID);
/*     */
/* 167 */       ResponseSupport rs = (ResponseSupport)client.invoke(req, null);
/*     */
/* 169 */       res = (CreateConnectionResult)rs.getResponse();
/*     */     }
/*     */     catch (Throwable t)
/*     */     {
/* 176 */       if (remotingConnection != null)
/*     */       {
/*     */         try
/*     */         {
/* 180 */           remotingConnection.stop();
/*     */         }
/*     */         catch (Throwable ignore)
/*     */         {
/*     */         }
/*     */       }
/*     */
/* 187 */       throw handleThrowable(t);
/*     */     }
/*     */
/* 190 */     ClientConnectionDelegate connectionDelegate = res.getDelegate();
/*     */
/* 192 */     if (connectionDelegate != null)
/*     */     {
/* 194 */       connectionDelegate.setRemotingConnection(remotingConnection);
/*     */
View Full Code Here

Examples of org.jboss.jms.delegate.CreateConnectionResult

/*     */           }
/*     */         }
/*     */
/* 131 */         log.trace(this + " has chosen " + delegate + " as target, " + (attemptCount == 0 ? "first connection attempt" : new StringBuilder().append(attemptCount).append(" connection attempts").toString()));
/*     */
/* 134 */         CreateConnectionResult res = delegate.createConnectionDelegate(username, password, failedNodeIDToServer);
/*     */
/* 137 */         ClientConnectionDelegate cd = res.getDelegate();
/*     */
/* 139 */         if (cd != null)
/*     */         {
/* 143 */           log.trace(this + " got local connection delegate " + cd);
/*     */
/* 145 */           if (supportsFailover)
/*     */           {
/* 147 */             ConnectionState state = (ConnectionState)cd.getState();
/*     */
/* 149 */             state.initializeFailoverCommandCenter();
/*     */
/* 151 */             FailoverCommandCenter fcc = state.getFailoverCommandCenter();
/*     */
/* 155 */             state.getRemotingConnection().getConnectionListener().setDelegateListener(new ConnectionFailureListener(fcc, state.getRemotingConnection()));
/*     */
/* 158 */             log.trace(this + " installed failure listener on " + cd);
/*     */
/* 162 */             state.setUsername(username);
/* 163 */             state.setPassword(password);
/*     */
/* 167 */             state.setClusteredConnectionFactoryDeleage(this.clusteredDelegate);
/*     */
/* 169 */             log.trace("Successfully initialised new connection");
/*     */           }
/*     */
/* 172 */           return res;
/*     */         }
/*     */
/* 177 */         if (!supportsFailover)
/*     */         {
/* 179 */           throw new IllegalStateException("Doesn't support failover so must return a connection delegate");
/*     */         }
/*     */
/* 184 */         int actualServerID = res.getActualFailoverNodeID();
/*     */
/* 186 */         if (actualServerID == -1)
/*     */         {
/* 194 */           log.debug("Client attempted failover, but no failover attempt has been detected on the server side. We will now try again on the original server in case there was a temporary glitch on the client--server network");
/*     */
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.