Package org.jboss.jms.server

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


      LocalTestServer server = new LocalTestServer();
     
      try
      {
         server.start("all", null, false, true);
         ServerPeer sp = server.getServerPeer();
         int interval = sp.getSuckerConnectionRetryInterval();
         assertEquals(5000, interval);
         int maxRetry = sp.getSuckerConnectionRetryTimes();
         assertEquals(-1, maxRetry);
      }
      finally
      {
         server.stop();
View Full Code Here


/* 116 */         throw new IllegalArgumentException("ServerPeer must be specified for each Connection Factory");
/*     */       }
/*     */
/* 120 */       String locatorURI = (String)JMXAccessor.getJMXAttributeOverSecurity(this.server, this.connectorObjectName, "InvokerLocator");
/*     */
/* 122 */       ServerPeer serverPeer = (ServerPeer)JMXAccessor.getJMXAttributeOverSecurity(this.server, this.serverPeerObjectName, "Instance");
/*     */
/* 124 */       if (!serverPeer.isSupportsFailover())
/*     */       {
/* 126 */         this.supportsFailover = false;
/*     */       }
/*     */
/* 129 */       InvokerLocator locator = new InvokerLocator(locatorURI);
/*     */
/* 131 */       String protocol = locator.getProtocol();
/*     */
/* 133 */       if ((!this.disableRemotingChecks) && ((protocol.equals("bisocket")) || (protocol.equals("sslbisocket"))))
/*     */       {
/* 140 */         Map params = locator.getParameters();
/*     */
/* 143 */         boolean cont = (checkParam(params, "marshaller", "org.jboss.jms.wireformat.JMSWireFormat")) && (checkParam(params, "unmarshaller", "org.jboss.jms.wireformat.JMSWireFormat")) && (checkParam(params, "dataType", "jms")) && (checkParam(params, "timeout", "0")) && (checkParam(params, "clientSocketClass", "org.jboss.jms.client.remoting.ClientSocketWrapper")) && (checkParam(params, "numberOfCallRetries", "1")) && (checkParam(params, "pingFrequency", "214748364")) && (checkParam(params, "pingWindowFactor", "10"));
/*     */
/* 153 */         if (!cont)
/*     */         {
/* 155 */           throw new IllegalArgumentException("Failed to deploy connection factory since remoting configuration seems incorrect.");
/*     */         }
/*     */
/* 158 */         String val = (String)params.get("clientLeasePeriod");
/* 159 */         if (val != null)
/*     */         {
/* 161 */           int i = Integer.parseInt(val);
/* 162 */           if (i < 5000)
/*     */           {
/* 164 */             this.log.warn("Value of clientLeasePeriod at " + i + " seems low. Normal values are >= 5000");
/*     */           }
/*     */         }
/*     */
/* 168 */         val = (String)params.get("clientMaxPoolSize");
/* 169 */         if (val != null)
/*     */         {
/* 171 */           int i = Integer.parseInt(val);
/* 172 */           if (i < 50)
/*     */           {
/* 174 */             this.log.warn("Value of clientMaxPoolSize at " + i + " seems low. Normal values are >= 50");
/*     */           }
/*     */         }
/*     */       }
/*     */
/* 179 */       this.connectionFactoryManager = serverPeer.getConnectionFactoryManager();
/* 180 */       this.connectorManager = serverPeer.getConnectorManager();
/* 181 */       this.connectionManager = serverPeer.getConnectionManager();
/*     */
/* 183 */       int refCount = this.connectorManager.registerConnector(this.connectorObjectName.getCanonicalName());
/*     */
/* 185 */       long leasePeriod = ((Long)JMXAccessor.getJMXAttributeOverSecurity(this.server, this.connectorObjectName, "LeasePeriod")).longValue();
/*     */
View Full Code Here

/*     */
/* 520 */     if (this.destination.isTopic())
/*     */     {
/* 522 */       PostOffice postOffice = this.sessionEndpoint.getConnectionEndpoint().getServerPeer().getPostOfficeInstance();
/*     */
/* 524 */       ServerPeer sp = this.sessionEndpoint.getConnectionEndpoint().getServerPeer();
/*     */
/* 526 */       Queue queue = postOffice.getBindingForQueueName(this.queueName).queue;
/*     */
/* 528 */       ManagedDestination mDest = sp.getDestinationManager().getDestination(this.destination.getName(), false);
/*     */
/* 530 */       if (!queue.isRecoverable())
/*     */       {
/* 532 */         postOffice.removeBinding(this.queueName, false);
/*     */
/* 534 */         if (!mDest.isTemporary())
/*     */         {
/* 536 */           String counterName = "Subscription." + this.queueName;
/*     */
/* 538 */           MessageCounter counter = sp.getMessageCounterManager().unregisterMessageCounter(counterName);
/*     */
/* 540 */           if (counter == null)
/*     */           {
/* 542 */             throw new IllegalStateException("Cannot find counter to remove " + counterName);
/*     */           }
View Full Code Here

/* 343 */     super.startService();
/*     */     try
/*     */     {
/* 347 */       TransactionManager tm = getTransactionManagerReference();
/*     */
/* 349 */       ServerPeer serverPeer = (ServerPeer)JMXAccessor.getJMXAttributeOverSecurity(this.server, this.serverPeerObjectName, "Instance");
/*     */
/* 351 */       MessageStore ms = serverPeer.getMessageStore();
/*     */
/* 353 */       PersistenceManager pm = serverPeer.getPersistenceManagerInstance();
/*     */
/* 355 */       TransactionRepository tr = serverPeer.getTxRepository();
/*     */
/* 357 */       IDManager idManager = serverPeer.getChannelIDManager();
/*     */
/* 359 */       int nodeId = serverPeer.getServerPeerID();
/*     */
/* 361 */       ClusterNotifier clusterNotifier = serverPeer.getClusterNotifier();
/*     */
/* 363 */       ConditionFactory cf = new JMSConditionFactory();
/*     */
/* 365 */       FilterFactory ff = new SelectorFactory();
/*     */
/* 367 */       if (this.clustered)
/*     */       {
/* 369 */         ChannelFactory jChannelFactory = null;
/*     */
/* 371 */         if (this.channelFactoryName != null)
/*     */         {
/* 373 */           Object info = null;
/*     */           try
/*     */           {
/* 376 */             info = this.server.getMBeanInfo(this.channelFactoryName);
/*     */           }
/*     */           catch (Exception e)
/*     */           {
/*     */           }
/*     */
/* 385 */           if (info != null)
/*     */           {
/* 387 */             this.log.debug(this + " uses MultiplexerJChannelFactory");
/*     */
/* 389 */             jChannelFactory = new MultiplexerChannelFactory(this.server, this.channelFactoryName, this.channelPartitionName, this.controlChannelName, this.dataChannelName);
/*     */           }
/*     */           else
/*     */           {
/* 395 */             this.log.debug(this + " uses XMLJChannelFactory");
/* 396 */             jChannelFactory = new XMLChannelFactory(this.controlChannelConfig, this.dataChannelConfig);
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/* 401 */           this.log.debug(this + " uses XMLJChannelFactory");
/* 402 */           jChannelFactory = new XMLChannelFactory(this.controlChannelConfig, this.dataChannelConfig);
/*     */         }
/*     */
/* 405 */         this.postOffice = new MessagingPostOffice(this.ds, tm, this.sqlProperties, this.createTablesOnStartup, nodeId, this.officeName, ms, pm, tr, ff, cf, idManager, clusterNotifier, this.groupName, jChannelFactory, this.stateTimeout, this.castTimeout, serverPeer.isSupportsFailover(), this.maxConcurrentReplications);
/*     */       }
/*     */       else
/*     */       {
/* 419 */         this.postOffice = new MessagingPostOffice(this.ds, tm, this.sqlProperties, this.createTablesOnStartup, nodeId, this.officeName, ms, pm, tr, ff, cf, idManager, clusterNotifier);
/*     */       }
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

                                               "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, "timeout", "0") &&
             checkParam(params, "clientSocketClass", "org.jboss.jms.client.remoting.ClientSocketWrapper") &&
             checkParam(params, "numberOfCallRetries", "1") &&
             checkParam(params, "pingFrequency", "214748364") &&
             checkParam(params, "pingWindowFactor", "10");
          
           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("clientMaxPoolSize")
           if (val != null)
           {
             int i = Integer.parseInt(val);
             if (i < 50)
             {
               log.warn("Value of 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");
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") &&
             checkParam(params, "numberOfCallRetries", "1") &&
             checkParam(params, "pingFrequency", "214748364") &&
             checkParam(params, "pingWindowFactor", "10");
          
           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");
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.