Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.BrokerAddress


    public ConsumerUID readPayloadConsumerUID() throws Exception {
        assert ( dis != null );
        ConsumerUID intid =  ClusterConsumerInfo.readConsumerUID(dis);
        if (c != null) {
            BrokerAddress ba = c.unmarshalBrokerAddress(pkt);
            if (ba != null) intid.setBrokerAddress(ba);
        }
        return intid;
    }
View Full Code Here


    }

    public boolean isWaitedfor(BrokerAddress me) throws Exception {
        List waitfor = getWaitfor();
        if (waitfor == null) return false;
        BrokerAddress b = null;
        TransactionBroker tb = null;
        Iterator itr = waitfor.iterator();
        while (itr.hasNext()) {
            tb = new TransactionBroker((BrokerAddress)itr.next());
            if (tb.getCurrentBrokerAddress().equals(me)) {
View Full Code Here

        StringBuffer buf = new StringBuffer();
        buf.append("\n\tTransactionID = ").append(getTransactionID());
        buf.append("\n\tTransactionState = ").append(TransactionState.toString(getTransactionState()));

        try {
        BrokerAddress b = getTransactionHome();
        if (b != null) buf.append("\n\tTransactionHome = ").append(b);
        } catch (Exception e) {
        buf.append("\n\tTransactionHome = ERROR:").append(e.toString());
        }
View Full Code Here

                                                            throws IOException
    {
        dos.writeLong(uid.longValue()); // UID write
        dos.writeLong((uid.getConnectionUID() == null ? 0 :
                                   uid.getConnectionUID().longValue()));
        BrokerAddress brokeraddr= uid.getBrokerAddress();
        if (brokeraddr == null) brokeraddr = Globals.getMyAddress();

        if (brokeraddr == null) {
            // XXX Revisit and cleanup : This method may be called
            // before cluster initialization only during persistent
            // store upgrade. i.e. from -
            // FalconProtocol.upgradeConfigChangeRecord()
            // At that time, Globals.getMyAddress() returns null.
            // Hence this kludge...
            try {
            brokeraddr =
            new com.sun.messaging.jmq.jmsserver.multibroker.fullyconnected.BrokerAddressImpl();
            }
            catch (Exception e) {}
        }

        brokeraddr.writeBrokerAddress(dos); // UID write
    }
View Full Code Here

    public static ConsumerUID readConsumerUID(DataInputStream dis)
          throws IOException
    {
        long id = dis.readLong(); // UID write
        ConnectionUID conuid = new ConnectionUID(dis.readLong());
        BrokerAddress tempaddr = Globals.getMyAddress();
        BrokerAddress brokeraddr = (BrokerAddress)tempaddr.clone();
        brokeraddr.readBrokerAddress(dis); // UID write
        ConsumerUID cuid = new ConsumerUID(id);
        cuid.setConnectionUID(conuid);
        cuid.setBrokerAddress(brokeraddr);
        return cuid;
    }
View Full Code Here

        Consumer cs = ClusterConsumerInfo.readConsumer(dis);
        Integer prefetch = (Integer)pkt.getProp(String.valueOf(
                                                cs.getConsumerUID().longValue())+
                                                ":"+Consumer.PREFETCH);
        if (prefetch != null) cs.setRemotePrefetch(prefetch.intValue());
        BrokerAddress from = c.unmarshalBrokerAddress(pkt);
        if (from != null) cs.getConsumerUID().setBrokerAddress(from);
    return cs;
    }
View Full Code Here

      TransactionState state = remoteTxn.getTransactionState();
      TransactionAcknowledgement  tas[] = remoteTxn.getTxnAcks();
      DestinationUID  destIds[] = remoteTxn.getDestIds();
      msg = " loadTransactions: processing remote transaction " + tid + " state= "+state;
      logger.log(Logger.DEBUG, msg);
      BrokerAddress remoteTransactionHomeBroker = remoteTxn.getTxnHomeBroker();
     
      transactionList.logRemoteTransaction(tid, state, tas,
          remoteTransactionHomeBroker, true, true, false);
     
      for(int i=0;i<tas.length;i++)
View Full Code Here

    public String toString() {
        if (!Globals.getHAEnabled()) {
      return "[" + broker.toString() + "]"+
                ((state == COMPLETE) ? "":toString(state));
        }
        BrokerAddress curr = getCurrentBrokerAddress();
      return "[" + broker.toString() + "("+(curr == null ? "":curr.toString())+")]"+
                ((state == COMPLETE) ? "":toString(state));
    }
View Full Code Here

                waittime = endtime - curtime;
            }
        }
        }

        BrokerAddress remote = null;
        BrokerLink l = null;
        synchronized(brokerList) {
            Iterator itr = brokerList.keySet().iterator();
            while (itr.hasNext()) {
                remote = (BrokerAddress)itr.next();
View Full Code Here

        }
    }

    private void closeLink(String brokerID, UID storeSession) {
        if (!Globals.getHAEnabled()) return;
        BrokerAddress remote = null;
        BrokerLink l = null;
        synchronized(brokerList) {
            Iterator itr = brokerList.keySet().iterator();
            while (itr.hasNext()) {
                remote = (BrokerAddress)itr.next();
                l = (BrokerLink)brokerList.get(remote);
                if (remote.getBrokerID().equals(brokerID) &&
                    (storeSession == null ||
                     remote.getStoreSessionUID().equals(storeSession))) {
                    logger.log(logger.WARNING, br.getKString(
                           br.W_CLUSTER_CLOSE_DOWN_BROKER_LINK, remote));
                    l.closeConn(false);
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.BrokerAddress

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.