Package org.jboss.jms.server

Examples of org.jboss.jms.server.ServerPeer$FailoverListener


            throw new IllegalArgumentException("ServerPeer must be specified for " +
                                               "each Connection Factory");
         }
     
         String locatorURI = (String)server.getAttribute(connectorObjectName, "InvokerLocator");
         ServerPeer serverPeer = (ServerPeer)server.getAttribute(serverPeerObjectName, "Instance");
        
         connectionFactoryManager = serverPeer.getConnectionFactoryManager();
         connectorManager = serverPeer.getConnectorManager();
         connectionManager = serverPeer.getConnectionManager();

         int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());

         long leasePeriod =
            ((Long)server.getAttribute(connectorObjectName, "LeasePeriod")).longValue();
View Full Code Here


   {
      if (sc.query(serverPeerObjectName).isEmpty())
      {
         return false;
      }
      ServerPeer sp = (ServerPeer)sc.getAttribute(serverPeerObjectName, "Instance");
      sp.getVersion();
      return true;
   }
View Full Code Here

   /**
    * Only for in-VM use!
    */
   public MessageStore getMessageStore() throws Exception
   {
      ServerPeer serverPeer = (ServerPeer)sc.getAttribute(serverPeerObjectName, "Instance");
      return serverPeer.getMessageStore();
   }
View Full Code Here

      return serverPeer.getMessageStore();
   }

   public DestinationManager getDestinationManager() throws Exception
   {
      ServerPeer serverPeer = (ServerPeer)sc.getAttribute(serverPeerObjectName, "Instance");
      return serverPeer.getDestinationManager();
   }
View Full Code Here

      return serverPeer.getDestinationManager();
   }

   public PersistenceManager getPersistenceManager() throws Exception
   {
      ServerPeer serverPeer = (ServerPeer)sc.getAttribute(serverPeerObjectName, "Instance");
      return serverPeer.getPersistenceManagerInstance();
   }
View Full Code Here

   public Colocated() throws Exception
   {
      sc = new ServiceContainer("transaction,remoting", null);
      sc.start();

      serverPeer = new ServerPeer(0, "/queue", "/topic");
      serverPeer.start();

      deployTopic("T");
      log.info("Topic messaging/topics/T deployed");
   }
View Full Code Here

      try
      {
         TransactionManager tm = getTransactionManagerReference();

         ServerPeer serverPeer = (ServerPeer)server.getAttribute(serverPeerObjectName, "Instance");
         MessageStore ms = serverPeer.getMessageStore();
         TransactionRepository tr = serverPeer.getTxRepository();
         PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
         int nodeId = serverPeer.getServerPeerID();

         Class clazz = Class.forName(messagePullPolicy);
         MessagePullPolicy pullPolicy = (MessagePullPolicy)clazz.newInstance();

         clazz = Class.forName(clusterRouterFactory);
View Full Code Here

     
      try
     
         TransactionManager tm = getTransactionManagerReference();
        
         ServerPeer serverPeer = (ServerPeer)server.getAttribute(serverPeerObjectName, "Instance");
        
         MessageStore ms = serverPeer.getMessageStore();
        
         PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
        
         TransactionRepository tr = serverPeer.getTxRepository();
        
         int nodeId = serverPeer.getServerPeerID();
        
         FilterFactory ff = new SelectorFactory();
        
         ConditionFactory cf = new JMSConditionFactory();
              
View Full Code Here

      assertEquals(name, q.getTopicName());     
   }
  
   public void testDestinationManager() throws Exception
   {
      ServerPeer sp = ServerManagement.getServer().getServerPeer();
     
      DestinationManager dm = sp.getDestinationManager();
     
      dm.stop();
     
      dm.start();
       
View Full Code Here

                                               "each Connection Factory");
         }
     
         String locatorURI = (String)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "InvokerLocator");

         ServerPeer serverPeer = (ServerPeer)JMXAccessor.getJMXAttributeOverSecurity(server, serverPeerObjectName, "Instance");

         if (!serverPeer.isSupportsFailover())
         {
            this.supportsFailover = false;
         }
        
         InvokerLocator locator = new InvokerLocator(locatorURI);
        
         String protocol = locator.getProtocol();
        
         if (!disableRemotingChecks && (protocol.equals("bisocket") || protocol.equals("sslbisocket")))
         {        
           //Sanity check - If users are using the AS Service Binding Manager to provide the remoting connector
           //configuration, it is quite easy for them to end up using an old version depending on what version on
           //the AS they are running in - e.g. if they have forgotten to update it.
           //This can lead to subtle errors - therefore we do a sanity check by checking the existence of some properties
           //which should always be there
           Map params = locator.getParameters();          
          
           //The "compulsory" parameters
           boolean cont =
             checkParam(params, "marshaller", "org.jboss.jms.wireformat.JMSWireFormat") &&              
             checkParam(params, "unmarshaller", "org.jboss.jms.wireformat.JMSWireFormat") &&
             checkParam(params, "dataType", "jms") &&
             checkParam(params, "clientSocketClass", "org.jboss.jms.client.remoting.ClientSocketWrapper");

           if (!cont)
           {
             throw new IllegalArgumentException("Failed to deploy connection factory since remoting configuration seems incorrect.");                                            
           }

           String val = (String)params.get("clientLeasePeriod");   
           if (val != null)
           {
             int i = Integer.parseInt(val);
             if (i < 5000)
             {
               log.warn("Value of clientLeasePeriod at " + i + " seems low. Normal values are >= 5000");
             }
           }
          
           val = (String)params.get("JBM_clientMaxPoolSize")
           if (val != null)
           {
             int i = Integer.parseInt(val);
             if (i < 50)
             {
               log.warn("Value of JBM_clientMaxPoolSize at " + i + " seems low. Normal values are >= 50");
             }
           }
         }

         connectionFactoryManager = serverPeer.getConnectionFactoryManager();
         connectorManager = serverPeer.getConnectorManager();
         connectionManager = serverPeer.getConnectionManager();

         int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());

         long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");

         // if leasePeriod <= 0, disable pinging altogether

         boolean enablePing = leasePeriod > 0;
        
         if (refCount == 1 && enablePing)
         {
            // install the connection listener that listens for failed connections           
            server.invoke(connectorObjectName, "addConnectionListener",
                  new Object[] {connectionManager},
                  new String[] {"org.jboss.remoting.ConnectionListener"});
         }
        
         // We use the MBean service name to uniquely identify the connection factory
        
         connectionFactoryManager.
            registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
                                      locatorURI, enablePing, prefetchSize, slowConsumers,
                                      defaultTempQueueFullSize, defaultTempQueuePageSize,                                     
                                      defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
                                      loadBalancingFactory, strictTck, sendAcksAsync, enableOrderingGroup, defaultOrderingGroupName,
                                      maxRetryChangeRate, retryChangeRateInterval, minTimeoutProcessTime);              
        
         String info = "Connector " + locator.getProtocol() + "://" +
            locator.getHost() + ":" + locator.getPort();
                
         if (enablePing)
         {
            info += " has leasing enabled, lease period " + leasePeriod + " milliseconds";
         }
         else
         {
            info += " has lease disabled";
         }
     
         log.info(info);
        
         serverPeer.registerCFForRecovery(serviceName);
         log.info(this + " started");
      }
      catch (Throwable t)
      {
         throw ExceptionUtil.handleJMXInvocation(t, this + " startService");
View Full Code Here

TOP

Related Classes of org.jboss.jms.server.ServerPeer$FailoverListener

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.