Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.broker.impl
Class BrokerConnectorImpl  view BrokerConnectorImpl download BrokerConnectorImpl.java

java.lang.Object
  extended byorg.activemq.broker.impl.BrokerConnectorImpl
All Implemented Interfaces:
org.activemq.broker.BrokerConnector, org.activemq.service.Service, org.activemq.transport.TransportChannelListener

public class BrokerConnectorImpl
extends java.lang.Object
implements org.activemq.broker.BrokerConnector, org.activemq.transport.TransportChannelListener

An implementation of the broker (the JMS server)

Version:
$Revision: 1.1.1.1 $

Field Summary
private  java.util.Map clients
           
private  org.activemq.broker.BrokerContainer container
           
private  org.apache.commons.logging.Log log
           
private  org.activemq.transport.TransportServerChannel serverChannel
           
 
Constructor Summary
BrokerConnectorImpl(org.activemq.broker.BrokerContainer container)
           
BrokerConnectorImpl(org.activemq.broker.BrokerContainer container, java.lang.String bindAddress, org.activemq.io.WireFormat wireFormat)
          Helper constructor for TCP protocol with the given bind address
BrokerConnectorImpl(org.activemq.broker.BrokerContainer container, org.activemq.transport.TransportServerChannel serverChannel)
           
 
Method Summary
 void acknowledgeMessage(org.activemq.broker.BrokerClient client, org.activemq.message.MessageAck ack)
          Acknowledge reciept of a message
 void addClient(org.activemq.transport.TransportChannel channel)
          Called when a new channel is added to a server
 void commitTransaction(org.activemq.broker.BrokerClient client, org.activemq.message.ActiveMQXid xid, boolean onePhase)
          Commit an XA transaction.
 void commitTransaction(org.activemq.broker.BrokerClient client, java.lang.String transactionId)
          Commit a transaction
protected static org.activemq.transport.TransportServerChannel createTransportServerChannel(org.activemq.io.WireFormat wireFormat, java.lang.String bindAddress)
          Factory method ot create a transport channel
 void deregisterClient(org.activemq.broker.BrokerClient client, org.activemq.message.ConnectionInfo info)
          Deregister a Broker Client
 void deregisterMessageConsumer(org.activemq.broker.BrokerClient client, org.activemq.message.ConsumerInfo info)
          De-register a MessageConsumer from the Broker
 void deregisterMessageProducer(org.activemq.broker.BrokerClient client, org.activemq.message.ProducerInfo info)
          De-register a MessageProducer from the Broker
 void deregisterSession(org.activemq.broker.BrokerClient client, org.activemq.message.SessionInfo info)
          De-register a client-side Session from the Broker (used for monitoring)
 void durableUnsubscribe(org.activemq.broker.BrokerClient client, org.activemq.message.DurableUnsubscribe ds)
          Command to delete a durable topic subscription
 int getBrokerCapacity()
          Get a hint about the broker capacity for more messages
 org.activemq.broker.BrokerContainer getBrokerContainer()
           
 org.activemq.message.BrokerInfo getBrokerInfo()
           
 org.activemq.message.ActiveMQXid[] getPreparedTransactions(org.activemq.broker.BrokerClient client)
          Gets the prepared XA transactions.
 java.lang.String getResourceManagerId(org.activemq.broker.BrokerClient client)
          Gets the unique id of the resource manager used for managing xa transactions.
 org.activemq.transport.TransportServerChannel getServerChannel()
           
 int prepareTransaction(org.activemq.broker.BrokerClient client, org.activemq.message.ActiveMQXid xid)
          Prepare an XA transaction.
 void registerClient(org.activemq.broker.BrokerClient client, org.activemq.message.ConnectionInfo info)
          Register a Broker Client
 void registerMessageConsumer(org.activemq.broker.BrokerClient client, org.activemq.message.ConsumerInfo info)
          Registers a MessageConsumer
 void registerMessageProducer(org.activemq.broker.BrokerClient client, org.activemq.message.ProducerInfo info)
          Registers a MessageProducer
 void registerSession(org.activemq.broker.BrokerClient client, org.activemq.message.SessionInfo info)
          Register a client-side Session (used for Monitoring)
 void removeClient(org.activemq.transport.TransportChannel channel)
          Called when a channel has been closed and removed from a server
 void rollbackTransaction(org.activemq.broker.BrokerClient client, org.activemq.message.ActiveMQXid xid)
          Rollback an XA transaction.
 void rollbackTransaction(org.activemq.broker.BrokerClient client, java.lang.String transactionId)
          Rollback a transacton
 void sendMessage(org.activemq.broker.BrokerClient client, org.activemq.message.ActiveMQMessage message)
          Send a non-transacted message to the Broker
 void start()
          start the Broker
 void startTransaction(org.activemq.broker.BrokerClient client, org.activemq.message.ActiveMQXid xid)
          Start an XA transaction.
 void startTransaction(org.activemq.broker.BrokerClient client, java.lang.String transactionId)
          Start a transaction from the Client session
 void stop()
          Stop the Broker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverChannel

private org.activemq.transport.TransportServerChannel serverChannel

log

private org.apache.commons.logging.Log log

container

private org.activemq.broker.BrokerContainer container

clients

private java.util.Map clients
Constructor Detail

BrokerConnectorImpl

public BrokerConnectorImpl(org.activemq.broker.BrokerContainer container,
                           java.lang.String bindAddress,
                           org.activemq.io.WireFormat wireFormat)
                    throws javax.jms.JMSException
Helper constructor for TCP protocol with the given bind address


BrokerConnectorImpl

public BrokerConnectorImpl(org.activemq.broker.BrokerContainer container,
                           org.activemq.transport.TransportServerChannel serverChannel)

BrokerConnectorImpl

public BrokerConnectorImpl(org.activemq.broker.BrokerContainer container)
Method Detail

getBrokerInfo

public org.activemq.message.BrokerInfo getBrokerInfo()
Specified by:
getBrokerInfo in interface org.activemq.broker.BrokerConnector

getBrokerCapacity

public int getBrokerCapacity()
Get a hint about the broker capacity for more messages

Specified by:
getBrokerCapacity in interface org.activemq.broker.BrokerConnector

getServerChannel

public org.activemq.transport.TransportServerChannel getServerChannel()
Specified by:
getServerChannel in interface org.activemq.broker.BrokerConnector

start

public void start()
           throws javax.jms.JMSException
start the Broker

Specified by:
start in interface org.activemq.service.Service

stop

public void stop()
          throws javax.jms.JMSException
Stop the Broker

Specified by:
stop in interface org.activemq.service.Service

registerClient

public void registerClient(org.activemq.broker.BrokerClient client,
                           org.activemq.message.ConnectionInfo info)
                    throws javax.jms.JMSException
Register a Broker Client

Specified by:
registerClient in interface org.activemq.broker.BrokerConnector

deregisterClient

public void deregisterClient(org.activemq.broker.BrokerClient client,
                             org.activemq.message.ConnectionInfo info)
                      throws javax.jms.JMSException
Deregister a Broker Client

Specified by:
deregisterClient in interface org.activemq.broker.BrokerConnector

registerMessageConsumer

public void registerMessageConsumer(org.activemq.broker.BrokerClient client,
                                    org.activemq.message.ConsumerInfo info)
                             throws javax.jms.JMSException
Registers a MessageConsumer

Specified by:
registerMessageConsumer in interface org.activemq.broker.BrokerConnector

deregisterMessageConsumer

public void deregisterMessageConsumer(org.activemq.broker.BrokerClient client,
                                      org.activemq.message.ConsumerInfo info)
                               throws javax.jms.JMSException
De-register a MessageConsumer from the Broker

Specified by:
deregisterMessageConsumer in interface org.activemq.broker.BrokerConnector

registerMessageProducer

public void registerMessageProducer(org.activemq.broker.BrokerClient client,
                                    org.activemq.message.ProducerInfo info)
                             throws javax.jms.JMSException
Registers a MessageProducer

Specified by:
registerMessageProducer in interface org.activemq.broker.BrokerConnector

deregisterMessageProducer

public void deregisterMessageProducer(org.activemq.broker.BrokerClient client,
                                      org.activemq.message.ProducerInfo info)
                               throws javax.jms.JMSException
De-register a MessageProducer from the Broker

Specified by:
deregisterMessageProducer in interface org.activemq.broker.BrokerConnector

registerSession

public void registerSession(org.activemq.broker.BrokerClient client,
                            org.activemq.message.SessionInfo info)
                     throws javax.jms.JMSException
Register a client-side Session (used for Monitoring)

Specified by:
registerSession in interface org.activemq.broker.BrokerConnector

deregisterSession

public void deregisterSession(org.activemq.broker.BrokerClient client,
                              org.activemq.message.SessionInfo info)
                       throws javax.jms.JMSException
De-register a client-side Session from the Broker (used for monitoring)

Specified by:
deregisterSession in interface org.activemq.broker.BrokerConnector

startTransaction

public void startTransaction(org.activemq.broker.BrokerClient client,
                             java.lang.String transactionId)
                      throws javax.jms.JMSException
Start a transaction from the Client session

Specified by:
startTransaction in interface org.activemq.broker.BrokerConnector

rollbackTransaction

public void rollbackTransaction(org.activemq.broker.BrokerClient client,
                                java.lang.String transactionId)
                         throws javax.jms.JMSException
Rollback a transacton

Specified by:
rollbackTransaction in interface org.activemq.broker.BrokerConnector

commitTransaction

public void commitTransaction(org.activemq.broker.BrokerClient client,
                              java.lang.String transactionId)
                       throws javax.jms.JMSException
Commit a transaction

Specified by:
commitTransaction in interface org.activemq.broker.BrokerConnector

sendMessage

public void sendMessage(org.activemq.broker.BrokerClient client,
                        org.activemq.message.ActiveMQMessage message)
                 throws javax.jms.JMSException
Send a non-transacted message to the Broker

Specified by:
sendMessage in interface org.activemq.broker.BrokerConnector

acknowledgeMessage

public void acknowledgeMessage(org.activemq.broker.BrokerClient client,
                               org.activemq.message.MessageAck ack)
                        throws javax.jms.JMSException
Acknowledge reciept of a message

Specified by:
acknowledgeMessage in interface org.activemq.broker.BrokerConnector

durableUnsubscribe

public void durableUnsubscribe(org.activemq.broker.BrokerClient client,
                               org.activemq.message.DurableUnsubscribe ds)
                        throws javax.jms.JMSException
Command to delete a durable topic subscription

Specified by:
durableUnsubscribe in interface org.activemq.broker.BrokerConnector

addClient

public void addClient(org.activemq.transport.TransportChannel channel)
Description copied from interface: org.activemq.transport.TransportChannelListener
Called when a new channel is added to a server

Specified by:
addClient in interface org.activemq.transport.TransportChannelListener

removeClient

public void removeClient(org.activemq.transport.TransportChannel channel)
Description copied from interface: org.activemq.transport.TransportChannelListener
Called when a channel has been closed and removed from a server

Specified by:
removeClient in interface org.activemq.transport.TransportChannelListener

getBrokerContainer

public org.activemq.broker.BrokerContainer getBrokerContainer()
Specified by:
getBrokerContainer in interface org.activemq.broker.BrokerConnector

startTransaction

public void startTransaction(org.activemq.broker.BrokerClient client,
                             org.activemq.message.ActiveMQXid xid)
                      throws javax.transaction.xa.XAException
Start an XA transaction.

Specified by:
startTransaction in interface org.activemq.broker.BrokerConnector

getPreparedTransactions

public org.activemq.message.ActiveMQXid[] getPreparedTransactions(org.activemq.broker.BrokerClient client)
                                                           throws javax.transaction.xa.XAException
Gets the prepared XA transactions.

Specified by:
getPreparedTransactions in interface org.activemq.broker.BrokerConnector

prepareTransaction

public int prepareTransaction(org.activemq.broker.BrokerClient client,
                              org.activemq.message.ActiveMQXid xid)
                       throws javax.transaction.xa.XAException
Prepare an XA transaction.

Specified by:
prepareTransaction in interface org.activemq.broker.BrokerConnector

rollbackTransaction

public void rollbackTransaction(org.activemq.broker.BrokerClient client,
                                org.activemq.message.ActiveMQXid xid)
                         throws javax.transaction.xa.XAException
Rollback an XA transaction.

Specified by:
rollbackTransaction in interface org.activemq.broker.BrokerConnector

commitTransaction

public void commitTransaction(org.activemq.broker.BrokerClient client,
                              org.activemq.message.ActiveMQXid xid,
                              boolean onePhase)
                       throws javax.transaction.xa.XAException
Commit an XA transaction.

Specified by:
commitTransaction in interface org.activemq.broker.BrokerConnector

getResourceManagerId

public java.lang.String getResourceManagerId(org.activemq.broker.BrokerClient client)
Description copied from interface: org.activemq.broker.BrokerConnector
Gets the unique id of the resource manager used for managing xa transactions.

Specified by:
getResourceManagerId in interface org.activemq.broker.BrokerConnector

createTransportServerChannel

protected static org.activemq.transport.TransportServerChannel createTransportServerChannel(org.activemq.io.WireFormat wireFormat,
                                                                                            java.lang.String bindAddress)
                                                                                     throws javax.jms.JMSException
Factory method ot create a transport channel