Examples of UID


Examples of com.arjuna.ats.arjuna.common.Uid

     * @param userTransactionID User transaction id
     * @return Returns the {@link Transaction} corresponding to the passed <code>userTransactionID</code>. If there
     *          is no such transaction, then this method returns null
     */
    public Transaction getUserTransaction(final UserTransactionID userTransactionID) {
        final Uid uid = this.userTransactions.get(userTransactionID);
        if (uid == null) {
            return null;
        }
        return TransactionImple.getTransaction(uid);
    }
View Full Code Here

Examples of com.arjuna.ats.arjuna.common.Uid

     */
    Transaction beginUserTransaction(final UserTransactionID userTransactionID) throws SystemException, NotSupportedException {
        this.getUserTransaction().begin();
        // get the tx that just got created and associated with the transaction manager
        final TransactionImple newlyAssociatedTx = TransactionImple.getTransaction();
        final Uid uid = newlyAssociatedTx.get_uid();
        this.userTransactions.put(userTransactionID, uid);
        return newlyAssociatedTx;
    }
View Full Code Here

Examples of com.enernoc.open.oadr2.model.Uid

                    .withIntervals( new Intervals()
                        .withIntervals( new Interval()
                          .withStreamPayloadBase( oadrTypes.createSignalPayload(
                              new SignalPayload(new PayloadFloat(1.0f))))
                          .withDuration( new DurationPropType(new DurationValue("PT1M")))
                          .withUid(new Uid("abc"))
                        )
                    )
                )
            )
        )
View Full Code Here

Examples of com.sun.messaging.jmq.util.UID

        return new BrokerAddressImpl(a.getHostName(),
                     a.getProperty("instName"),
                     a.getPort(),
           !(ha == null),
                     a.getProperty("brokerID"),
                     new UID(Long.valueOf(a.getProperty("brokerSessionUID")).longValue()),
                     ((ha == null) ? null:
                      new UID(Long.valueOf(a.getProperty("storeSessionUID")).longValue())));
    }
View Full Code Here

Examples of com.sun.messaging.jmq.util.UID

        String instName = (String)gp.getProp("instanceName");
        String host = (String)gp.getProp("host");
        int port = ((Integer)gp.getProp("port")).intValue();
        Long brokerSession = (Long)gp.getProp("brokerSession");
        Long storeSession = (Long)gp.getProp("storeSession");
        UID buid = null
        UID suid = null
        if (brokerSession != null) buid = new UID(brokerSession.longValue());
        if (storeSession != null) suid = new UID(storeSession.longValue());
        BrokerAddressImpl ba = new BrokerAddressImpl(host, instName, port, ha, brokerID, buid, suid);
        return ba;
    }
View Full Code Here

Examples of com.sun.messaging.jmq.util.UID

        Iterator itr = null;
        synchronized(takingoverTargets) {
            itr = takingoverTargets.iterator();
            while (itr.hasNext()) {
                target = (TakingoverTracker)itr.next();
                UID ss = target.getStoreSessionUID();
                if (target.getBrokerID().equals(brokerID) &&
                    ((ss == null &&
                      target.getDownStoreSessionUID().equals(storeSession)) ||
                     (ss != null &&
                      (ss.equals(storeSession) ||
                       target.getDownStoreSessionUID().equals(storeSession))))) {
                    return true;
                }
            }
        }
View Full Code Here

Examples of com.sun.messaging.jmq.util.UID

        BrokerAddress currAddr = ref.getAddress();
        if (oldAddr == null && currAddr == null) return false;
        if ((oldAddr == null && currAddr != null) ||
            (oldAddr != null && currAddr == null)) return true;
        if (!oldAddr.equals(currAddr)) return true;
        UID oldUID = oldAddr.getBrokerSessionUID();
        UID currUID = currAddr.getBrokerSessionUID();
        if (oldUID == null || currUID == null) return false;
        if (!oldUID.equals(currUID)) return true;
        return false;
    }
View Full Code Here

Examples of com.sun.messaging.jmq.util.UID

          int requestedProtocol = 0;
          int highestProtocol = con.getHighestSupportedProtocol();
          int lowestProtocol = PacketType.VERSION1;

          String expectedClusterID = null;
          UID expectedSessionID = null;
          ConnectionUID oldCID = null;
          Integer bufsize = null;
          boolean badClientType = false;
          if (hello_props != null) {
              Integer level = (Integer)hello_props.get("JMQProtocolLevel");
              if (level == null) {
                  requestedProtocol=PacketType.VERSION1;
              } else {
                  requestedProtocol=level.intValue();
              }
               bufsize = (Integer)hello_props.get("JMQSize");
              if (bufsize == null) { //XXX try old protocol
                  bufsize = (Integer)hello_props.get("JMQRBufferSize");
              }

              // Retrieve HA related properties
              Long longUID = (Long)hello_props.get("JMQStoreSession");
              if (longUID != null) {
                  expectedSessionID = new UID(longUID.longValue());
              }

              expectedClusterID = (String)hello_props.get("JMQClusterID");

              Boolean reconnectable = (Boolean)hello_props.get("JMQReconnectable");
              Boolean haclient = (Boolean)hello_props.get("JMQHAClient");
              if (Globals.getHAEnabled() && haclient != null && haclient.booleanValue()) {
                  reconnectable = haclient;
              }

              String s = (String)hello_props.get("JMQUserAgent");
              if (!ALLOW_C_CLIENTS && s != null &&  s.indexOf("C;") != -1) {
                  badClientType = true;
              }
              if (s != null) {
                con.addClientData(IMQConnection.USER_AGENT, s);
              }

              longUID = (Long)hello_props.get("JMQConnectionID");

              if (longUID != null) {
                  logger.log(Logger.DEBUG,"Have old connectionUID");
                  oldCID = new ConnectionUID(longUID.longValue());
                  logger.log(Logger.INFO,
                         BrokerResources.I_RECONNECTING, oldCID);
                  logger.log(Logger.DEBUG,"Checking for active connection");

                  Connection oldcon = Globals.getConnectionManager().getConnection(oldCID);
                  DUMP("Before connection Destroy");
                  if (oldcon != null) {
                      logger.log(Logger.DEBUG,"Destroying old connection " + oldCID);
                      oldcon.destroyConnection(true,GoodbyeReason.ADMIN_KILLED_CON, "Destroying old connection with same connectionUID " + oldCID + " - reconnect is happening before connection was reaped");
                  }
/* LKS
                  DUMP();

                  logger.log(Logger.DEBUG,"Updating connection in id list " +
                           "["+oldcid + "," + uid + "]");
                  // old code
                  con.setConnectionUID(oldcid);
                  Globals.getConnectionManager().updateConnectionUID(
                         oldcid, uid);
                  //Globals.getConnectionManager().updateConnectionUID(
                  //       uid, oldcid);
*/
                  DUMP("After Connection Destroy");
              }

              con.getConnectionUID().setCanReconnect(reconnectable == null ? false :
                      reconnectable.booleanValue());

              Long interval = (Long)hello_props.get("JMQInterval");

              // LKS - XXX just override for testing
              long itime = interval == null ? 10000 : interval.intValue();
              con.setReconnectInterval(itime);
              
          } else {
              requestedProtocol=PacketType.VERSION1;
          }

          int supportedProtocol = 0;
          if (requestedProtocol > highestProtocol) {
              supportedProtocol = highestProtocol;
          } else if (requestedProtocol < lowestProtocol) {
              supportedProtocol = lowestProtocol;
          else {
              supportedProtocol = requestedProtocol;
          }
          con.setClientProtocolVersion(supportedProtocol);

           if (bufsize != null) {
              logger.log(Logger.DEBUG, "Received JMQRBufferSize -" + bufsize);
              con.setFlowCount(bufsize.intValue());
           }


          Packet pkt = new Packet(con.useDirectBuffers());
          pkt.setPacketType(PacketType.HELLO_REPLY);
          pkt.setConsumerID(msg.getConsumerID());
          Hashtable hash = new Hashtable();
          reason = "unavailable";
          int status = Status.UNAVAILABLE;

          // If the connection's remote IP address was not set by the
          // protocol, then use the IP in the message packet.
          if (con.getRemoteIP() == null) {
            con.setRemoteIP(msg.getIP());
          }


          if ((alreadyAuthenticated || alreadyStarted)
                  && !msg.getIndempotent() ) { // handle ibit
              status = Status.ERROR;
              reason = "Connection reuse not allowed";
              if (alreadyAuthenticated) {
                  logger.log(Logger.WARNING,"Internal Error: " +
                    " received HELLO on already authenticated connection "
                    + con.getRemoteConnectionString() +
                    " " + con.getConnectionUID());
              } else {
                  logger.log(Logger.WARNING,"Internal Error: " +
                    " received HELLO on already started connection "
                    + con.getRemoteConnectionString() +
                    " " + con.getConnectionUID());
              }
         
          } else if (badClientType) {
              logger.log(Logger.ERROR, rb.E_FEATURE_UNAVAILABLE,
                   Globals.getBrokerResources().getString(
                        BrokerResources.M_C_API));
              reason = "C clients not allowed on this version";
        status = Status.UNAVAILABLE;
          } else if (!CAN_RECONNECT && con.getConnectionUID().getCanReconnect()) {
              logger.log(Logger.ERROR, rb.E_FEATURE_UNAVAILABLE,
                   Globals.getBrokerResources().getString(
                        BrokerResources.M_CLIENT_FAILOVER));
              reason = "Client Failover not allowed on this version";
          } else if (requestedProtocol != supportedProtocol) {
              // Bad protocol level.
              logger.log(Logger.WARNING, rb.W_BAD_PROTO_VERSION,
                Integer.toString(requestedProtocol),
                Integer.toString(supportedProtocol));

              reason = "bad version";
        status = Status.BAD_VERSION;
          } else if (con.getConnectionState() != Connection.STATE_UNAVAILABLE) {
              /**
               * connection may not be able to be created e.g:
               * licensing, being destroyed (e.g due to timeout)
               */
              if (con.setConnectionState(Connection.STATE_INITIALIZED)) {
                  reason = null;
                  status = Status.OK;
              } else {
                  status = Status.UNAVAILABLE;
        }
          } else {
        status = Status.UNAVAILABLE;
          }
         
          UID brokerSessionID = Globals.getBrokerSessionID();
          if (brokerSessionID!=null){
            hash.put("JMQBrokerSessionID",new Long(brokerSessionID.longValue()));
          }
         
          // OK, handle the HA properties HERE

          String clusterID = null;
          UID sessionUID = null;
          Set supportedSessions = null;

          ClusterManager cfg = Globals.getClusterManager();
          if (cfg != null) {
              clusterID = cfg.getClusterId();
              sessionUID = cfg.getStoreSessionUID();

              hash.put("JMQHA",Boolean.valueOf(cfg.isHA()));

              if (clusterID != null) {
                  hash.put("JMQClusterID", clusterID);
              }
              if (sessionUID != null)  {
                  hash.put("JMQStoreSession",new Long(sessionUID.longValue()));
              }

              String list = null;
              Iterator itr = null;
              if (((IMQService)con.getService()).getServiceType() != ServiceType.ADMIN) {
View Full Code Here

Examples of com.tangosol.util.UID

    public void memberJoined(MemberEvent memberEvent) {
        if (memberEvent.isLocal()) {
            done = false;
            // We left and re-joined the cluster
            Log.info("Rejoining cluster as node: " + new UID(CacheFactory.getClusterMemberID()) + ". Senior Member: " +
                    (CacheFactory.isSeniorClusterMember() ? "YES" : "NO"));
            // Simulate insert events of existing cache content
            simuateCacheInserts(C2SCache);
            simuateCacheInserts(anonymousC2SCache);
            simuateCacheInserts(S2SCache);
View Full Code Here

Examples of java.rmi.server.UID

     * so that these concepts are *near* each other.</P>
     */
    public static String computeIdentity()
    {
        String tIdent = null;
        UID tUid = new UID();
        tIdent = tUid.toString();
        try {
            java.net.InetAddress tInet = java.net.InetAddress.getLocalHost();
            String tAddress = tInet.getHostAddress();
            StringTokenizer tTokenizer = new StringTokenizer(tAddress, ".");
            while (tTokenizer.hasMoreTokens()){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.