Package org.jboss.jms.client.remoting

Examples of org.jboss.jms.client.remoting.JMSRemotingConnection


         return invocation.invokeNext();
      }
     
      FailoverValve2 valve = fcc.getValve();
     
      JMSRemotingConnection remotingConnection = null;
      String methodName = ((MethodInvocation)invocation).getMethod().getName();

      boolean left = false;
     
      try
View Full Code Here


   {
      Object ret = invocation.invokeNext();
     
      ConnectionState state = getConnectionState(invocation);

      JMSRemotingConnection remotingConnection = state.getRemotingConnection();

      // remove the consolidated remoting connection listener

      ConsolidatedRemotingConnectionListener l = remotingConnection.removeConnectionListener();
      if (l != null)
      {
         l.clear();
      }

      // Finished with the connection - we need to shutdown callback server
      remotingConnection.stop();
      
      // Remove reference to message ID generator
      MessageIdGeneratorFactory.instance.checkInGenerator(state.getServerID());
     
      // And to resource manager
View Full Code Here

     
      Version version = getVersionToUse(serverVersion);
     
      byte v = version.getProviderIncrementingVersion();
                      
      JMSRemotingConnection remotingConnection = null;
     
      CreateConnectionResult res;
     
      try
      {        
         remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing);
        
         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);
        
         connectionDelegate.setVersionToUse(version);

         remotingConnection.getCallbackManager().setConnectionDelegate(connectionDelegate);
      }
      else
      {
         //Wrong server redirect on failure
         //close the remoting connection
         try
         {
            remotingConnection.stop();
         }
         catch (Throwable ignore)
         {
         }
      }
View Full Code Here

         if(trace) { log.trace(connectionDelegate + " not configured, configuring ..."); }

         int serverID = connectionDelegate.getServerID();
         Version versionToUse = connectionDelegate.getVersionToUse();
         JMSRemotingConnection remotingConnection = connectionDelegate.getRemotingConnection();

         // install the consolidated remoting connection listener; it will be de-installed on
         // connection closing by ConnectionAspect

         ConsolidatedRemotingConnectionListener listener =
            new ConsolidatedRemotingConnectionListener();

         remotingConnection.addConnectionListener(listener);

         if (versionToUse == null)
         {
            throw new IllegalStateException("Connection version is null");
         }
View Full Code Here

      producer.send(session.createTextMessage("Hello again before failover"));

      ClientConnectionDelegate delegate = (ClientConnectionDelegate) conn.getDelegate();

      JMSRemotingConnection originalRemoting = delegate.getRemotingConnection();

      ServerManagement.kill(1);

      Thread.sleep(60000);
      // if failover happened, this object was replaced
View Full Code Here

      {
         connection = (JBossConnection)cf.createConnection();
         connection.start();

         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
         Client client = remotingConnection.getRemotingClient();

         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
         field.setAccessible(true);
         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
         String transport = locator.getProtocol();
View Full Code Here

        
         connection = (JBossConnection)cf.createConnection();
         connection.start();

         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
         Client client = remotingConnection.getRemotingClient();

         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
         field.setAccessible(true);
         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
         String transport = locator.getProtocol();

         if ("socket".equals(transport)
               || "sslsocket".equals(transport)
               || "bisocket".equals(transport)
               || "sslbisocket".equals(transport))
         {
            field = Client.class.getDeclaredField("callbackConnectors");
            field.setAccessible(true);
            Map callbackConnectors = (Map)field.get(client);

            InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
            Connector connector = (Connector)callbackConnectors.get(callbackHandler);
            locator = new InvokerLocator(connector.getInvokerLocator());
            assertEquals(address, locator.getHost());
            assertEquals(freePort, locator.getPort());
         }
View Full Code Here

      // synchronize (recursively) the client-side state

      state.synchronizeWith(newDelegate.getState());
     
      JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();

      client = conn.getRemotingClient();
     
      onewayClient = conn.getOnewayClient();
     
      strictTck = conn.isStrictTck();
     
      sendAcksAsync = conn.isSendAcksAsync();
   }
View Full Code Here

   public void setState(HierarchicalState state)
   {
      super.setState(state);
     
      JMSRemotingConnection conn = ((ConnectionState)state.getParent()).getRemotingConnection();

      client = conn.getRemotingClient();
     
      onewayClient = conn.getOnewayClient();
     
      strictTck = conn.isStrictTck();
     
      sendAcksAsync = conn.isSendAcksAsync();
   }
View Full Code Here

         if(trace) { log.trace(connectionDelegate + " not configured, configuring ..."); }

         int serverID = connectionDelegate.getServerID();
         Version versionToUse = connectionDelegate.getVersionToUse();
         JMSRemotingConnection remotingConnection = connectionDelegate.getRemotingConnection();

         if (versionToUse == null)
         {
            throw new IllegalStateException("Connection version is null");
         }

         ConnectionState connectionState =
            new ConnectionState(serverID, connectionDelegate,
                                remotingConnection, versionToUse,
                                connectionDelegate.isEnableOrderingGroup(), connectionDelegate.getDefaultOrderingGroupName(),
                                connectionDelegate.getMaxRetryChangeRate(), connectionDelegate.getRetryChangeRateInterval(),
                                connectionDelegate.getMinTimeoutProcessTime());

         remotingConnection.getConnectionListener().setConnectionState(connectionState);
         remotingConnection.getConnectionListener().start();
         
         connectionDelegate.setState(connectionState);
      }

      return res;
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.remoting.JMSRemotingConnection

Copyright © 2018 www.massapicom. 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.