Package org.hornetq.core.version

Examples of org.hornetq.core.version.Version


   {
      boolean incompatibleVersion = false;
      Packet response;
      try
      {
         Version version = server.getVersion();
         int[] compatibleList = version.getCompatibleVersionList();
         boolean isCompatibleClient = false;
         for (int i = 0; i < compatibleList.length; i++)
         {
            if (compatibleList[i] == request.getVersion())
            {
               isCompatibleClient = true;
               break;
            }
         }

         if (!isCompatibleClient)
         {
            log.warn("Client with version " + request.getVersion() +
                     " and address " +
                     connection.getRemoteAddress() +
                     " is not compatible with server version " +
                     version.getFullVersion() +
                     ". " +
                     "Please ensure all clients and servers are upgraded to the same version for them to " +
                     "interoperate properly");
            throw new HornetQException(HornetQException.INCOMPATIBLE_CLIENT_SERVER_VERSIONS,
                                       "Server and client versions incompatible");
View Full Code Here


         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  channel1.getLock().lock();

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (exitLock)
               {
                  inCreateSession = true;
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateSimpleStringUUID().toString();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            CoreRemotingConnection theConnection = null;

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  theConnection = getConnectionWithRetry(reconnectAttempts);

                  if (theConnection == null)
                  {
                     if (exitLoop)
                     {
                        return null;
                     }

                     if (failoverOnInitialConnection && backupConnectorFactory != null)
                     {
                        // Try and connect to the backup

                        log.warn("Server is not available to make initial connection to. Will " + "try backup server instead.");

                        connectorFactory = backupConnectorFactory;

                        transportParams = backupTransportParams;

                        backupConnectorFactory = null;

                        backupTransportParams = null;

                        theConnection = getConnectionWithRetry(reconnectAttempts);
                     }

                     if (exitLoop)
                     {
                        return null;
                     }

                     if (theConnection == null)
                     {
                        throw new HornetQException(HornetQException.NOT_CONNECTED,
                                                   "Unable to connect to server using configuration " + connectorConfig);
                     }
                  }

                  channel1 = theConnection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  channel1.getLock().lock();

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (exitLock)
               {
                  inCreateSession = true;
               }

               long sessionChannelID = theConnection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         minLargeMessageSize,
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  channel1.getLock().lock();

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (exitLock)
               {
                  inCreateSession = true;
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  channel1.getLock().lock();

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (exitLock)
               {
                  inCreateSession = true;
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  while (!channel1.getLock().tryLock(100, TimeUnit.MILLISECONDS))
                  {
                     if (exitLoop)
                        throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  }

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (inCreateSessionGuard)
               {
                  if (exitLoop)
                     throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  inCreateSession = true;
                  inCreateSessionLatch = new CountDownLatch(1);
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  while (!channel1.getLock().tryLock(100, TimeUnit.MILLISECONDS))
                  {
                     if (exitLoop)
                        throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  }

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (inCreateSessionGuard)
               {
                  if (exitLoop)
                     throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  inCreateSession = true;
                  inCreateSessionLatch = new CountDownLatch(1);
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateStringUUID();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  if (connection == null)
                  {
                     throw new IllegalStateException("Connection is null");
                  }

                  channel1 = connection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  while (!channel1.getLock().tryLock(100, TimeUnit.MILLISECONDS))
                  {
                     if (exitLoop)
                        throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  }

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (inCreateSessionGuard)
               {
                  if (exitLoop)
                     throw HornetQClientMessageBundle.BUNDLE.clientSessionClosed();
                  inCreateSession = true;
                  inCreateSessionLatch = new CountDownLatch(1);
               }

               long sessionChannelID = connection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         serverLocator.getMinLargeMessageSize(),
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

         String name = UUIDGenerator.getInstance().generateSimpleStringUUID().toString();

         boolean retry = false;
         do
         {
            Version clientVersion = VersionLoader.getVersion();

            CoreRemotingConnection theConnection = null;

            Lock lock = null;

            try
            {
               Channel channel1;

               synchronized (failoverLock)
               {
                  theConnection = getConnectionWithRetry(reconnectAttempts);

                  if (theConnection == null)
                  {
                     if (exitLoop)
                     {
                        return null;
                     }

                     if (failoverOnInitialConnection && backupConnectorFactory != null)
                     {
                        // Try and connect to the backup

                        log.warn("Server is not available to make initial connection to. Will " + "try backup server instead.");

                        connectorFactory = backupConnectorFactory;

                        transportParams = backupTransportParams;

                        backupConnectorFactory = null;

                        backupTransportParams = null;

                        theConnection = getConnectionWithRetry(reconnectAttempts);
                     }

                     if (exitLoop)
                     {
                        return null;
                     }

                     if (theConnection == null)
                     {
                        throw new HornetQException(HornetQException.NOT_CONNECTED,
                                                   "Unable to connect to server using configuration " + connectorConfig);
                     }
                  }

                  channel1 = theConnection.getChannel(1, -1);

                  // Lock it - this must be done while the failoverLock is held
                  channel1.getLock().lock();

                  lock = channel1.getLock();
               } // We can now release the failoverLock

               // We now set a flag saying createSession is executing
               synchronized (exitLock)
               {
                  inCreateSession = true;
               }

               long sessionChannelID = theConnection.generateChannelID();

               Packet request = new CreateSessionMessage(name,
                                                         sessionChannelID,
                                                         clientVersion.getIncrementingVersion(),
                                                         username,
                                                         password,
                                                         minLargeMessageSize,
                                                         xa,
                                                         autoCommitSends,
View Full Code Here

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

   public void testLoadVersion() throws Exception
   {
      Version version = VersionLoader.getVersion();
      Properties props = new Properties();
      props.load(ClassLoader.getSystemResourceAsStream(VersionLoader.PROP_FILE_NAME));

      Assert.assertEquals(props.get("hornetq.version.versionName"), version.getVersionName());
      Assert.assertEquals(props.get("hornetq.version.versionSuffix"), version.getVersionSuffix());

      Assert.assertEquals(Integer.parseInt((String)props.get("hornetq.version.majorVersion")),
                          version.getMajorVersion());
      Assert.assertEquals(Integer.parseInt((String)props.get("hornetq.version.minorVersion")),
                          version.getMinorVersion());
      Assert.assertEquals(Integer.parseInt((String)props.get("hornetq.version.microVersion")),
                          version.getMicroVersion());
      Assert.assertEquals(Integer.parseInt((String)props.get("hornetq.version.incrementingVersion")),
                          version.getIncrementingVersion());
   }
View Full Code Here

TOP

Related Classes of org.hornetq.core.version.Version

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.