Package org.jboss.util.id

Examples of org.jboss.util.id.GUID


   public Client(ClassLoader cl, ClientInvoker invoker, String subsystem) throws Exception
   {
      this.classloader = cl;
      this.subsystem = subsystem == null ? null : subsystem.toUpperCase();
      this.invoker = invoker;
      this.sessionId = new GUID().toString();
   }
View Full Code Here


   {
      String listenerId = null;
      Object obj = listeners.get(callbackhandler);
      if(obj == null)
      {
         listenerId = new GUID().toString();
         listeners.put(callbackhandler, listenerId);
      }
      return listenerId;
   }
View Full Code Here

            }
         }

         // if got this far, the entry does not exist, so need to add it and create a listener id
         CallbackHandlerHolder holder = new CallbackHandlerHolder(callbackhandler, locator);
         listenerId = new GUID().toString();
         String key = listenerId;
         if (sessionId != null)
            key = sessionId + "+" + listenerId;
         localServerLocators.put(key, holder);
      }
View Full Code Here

      this.subsystem = subsystem == null ? null : subsystem.toUpperCase();
      if (configuration != null)
      {
         this.configuration = new HashMap(configuration);
      }
      this.sessionId = new GUID().toString();
      processParameters();
   }
View Full Code Here

   public Client(ClassLoader cl, ClientInvoker invoker, String subsystem) throws Exception
   {
      this.classloader = cl;
      this.subsystem = subsystem == null ? null : subsystem.toUpperCase();
      this.invoker = invoker;
      this.sessionId = new GUID().toString();
   }
View Full Code Here

   {
      String listenerId = null;
      Object obj = listeners.get(callbackhandler);
      if(obj == null)
      {
         listenerId = new GUID().toString();
         listeners.put(callbackhandler, listenerId);
      }
      return listenerId;
   }
View Full Code Here

      {     
         int iterations = numMessages / commitSize;
        
         MessagingXid xid = null;
        
         xid = new MessagingXid("bq1".getBytes(), 1, new GUID().toString().getBytes());
         xaResource.start(xid, XAResource.TMNOFLAGS);
        
         for (int outerCount = 0; outerCount < iterations; outerCount++)
         {
                                               
            for (int innerCount = 0; innerCount < commitSize; innerCount++)
            {
               Message m = getMessage();
                       
               if (m == null)
               {
                  log.error("Message is null");
                  setFailed(true);
                  return;
               }
               String prodName = m.getStringProperty("PROD_NAME");
               Integer msgCount = new Integer(m.getIntProperty("MSG_NUMBER"));
              
               Count count = (Count)counts.get(prodName);
               if (count == null)
               {
                  //First time
                  if (msgCount.intValue() != 0)
                  {
                     log.error("First message from " + prodName + " is not 0, it is " + msgCount);
                     setFailed(true);
                     return;
                  }
                  else
                  {
                     count = new Count();
                     counts.put(prodName, count);
                  }
               }
               else
               {
                  if (count.lastCommitted != msgCount.intValue() - 1)
                  {
                     log.error("Message out of sequence for " + prodName + ", expected " + (count.lastCommitted + 1) + ", actual " + msgCount);
                     setFailed(true);
                     return;
                  }
               }
               count.lastCommitted = msgCount.intValue();
              
               count.lastReceived = msgCount.intValue();
              
               if (innerCount == commitSize -1)
               {
                  xaResource.end(xid, XAResource.TMSUCCESS);
                  xaResource.prepare(xid);
                  xaResource.commit(xid, false);
                                   
                  //Starting new tx
                  xid = new MessagingXid("bq1".getBytes(), 1, new GUID().toString().getBytes());
                  xaResource.start(xid, XAResource.TMNOFLAGS);
                
               }
              
               processingDone();           
            }           
                       
            if (outerCount == iterations - 1)
            {
               break;
            }
                                      
            for (int innerCount = 0; innerCount < rollbackSize; innerCount++)
            {
               Message m = getMessage();
              
               if (m == null)
               {
                  log.error("Message is null (rollback)");
                  setFailed(true);
                  return;
               }
               String prodName = m.getStringProperty("PROD_NAME");              
               Integer msgCount = new Integer(m.getIntProperty("MSG_NUMBER"));
                   
               Count count = (Count)counts.get(prodName);
               if (count == null)
               {
                  // First time
                  if (msgCount.intValue() != 0)
                  {
                     log.error("First message from " + prodName + " is not 0, it is " + msgCount);
                     setFailed(true);
                     return;
                  }
                  else
                  {
                     count = new Count();
                     count.lastCommitted = -1;
                     counts.put(prodName, count);
                  }                
               }
               else
               {
                  if (count.lastReceived != msgCount.intValue() - 1)
                  {
                     log.error("Message out of sequence");
                     setFailed(true);
                     return;
                  }
               }
               count.lastReceived = msgCount.intValue();         
              
               if (innerCount == rollbackSize -1)
               {
                  xaResource.end(xid, XAResource.TMSUCCESS);
                  xaResource.prepare(xid);
                  xaResource.rollback(xid);
                 
                  xid = new MessagingXid("bq1".getBytes(), 1, new GUID().toString().getBytes());
                  xaResource.start(xid, XAResource.TMNOFLAGS);
               }
               processingDone();
            }           
         }
View Full Code Here

            // Setting the port prevents the Remoting Client from using PortUtil.findPort(), which
            // creates ServerSockets. The actual value of the port shouldn't matter. To "guarantee"
            // that each InvokerLocator is unique, a GUID is appended to the InvokerLocator.
            if (propertyPort == null)
            {
               String guid = new GUID().toString();
               int hash = guid.hashCode();
              
               // Make sure the hash code is > 0.
               // See http://jira.jboss.org/jira/browse/JBMESSAGING-863.
               while(hash <= 0)
View Full Code Here

         String objectStoreDir = System.getProperty("objectstore.dir");
         log.trace("ObjectStoreDir===" + objectStoreDir);
        
         // We must ensure each node has its own object store
        
         String newObjectStore = name + new GUID().toString();
        
         if (objectStoreDir != null)
         {
            // Delete the old one
            // deleteDirectory(new File(objectStoreDir));
           
            newObjectStore = objectStoreDir + "/" + newObjectStore;
         }
        
         log
               .info("Setting com.arjuna.ats.arjuna.common.Environment.OBJECTSTORE_DIR to "
                     + newObjectStore);
        
         System.setProperty(
               com.arjuna.ats.arjuna.common.Environment.OBJECTSTORE_DIR,
               newObjectStore);
        
         // We must also make sure the node identifier is unique for each node
         // Otherwise xids might overlap
         String arjunanodeId = "TestNodeID-" + new GUID().toString();
        
         log
               .info("Setting com.arjuna.ats.arjuna.common.Environment.XA_NODE_IDENTIFIER to "
                     + arjunanodeId);
        
View Full Code Here

               if(trace) { log.trace(this + " sending initial lease ping to server to determine if server has leasing enabled."); }

               // configuration should NOT be passed as want ping to be specific to client invoker
               // and NOT to the client.

               String leasePingerId = new GUID().toString();
               Map requestMap = new HashMap();
               requestMap.put(LeasePinger.LEASE_PINGER_ID, leasePingerId);
               requestMap.put(LeasePinger.TIME_STAMP, Long.toString(System.currentTimeMillis()));
               requestMap.put(ServerInvoker.TIMEOUT, leaseCreationTimeout);
               if (trace) log.trace(this + " initiating lease for leasePingerId " + leasePingerId);
View Full Code Here

TOP

Related Classes of org.jboss.util.id.GUID

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.