public class Broker
extends java.lang.Object
Constructor and Description |
---|
Broker(java.util.Properties env) |
Modifier and Type | Method and Description |
---|---|
void |
bind(java.lang.String reference,
RemoteObject remote)
Binds the reference to the specified remote object.
|
void |
bind(java.lang.String reference,
RemoteObject remote,
java.util.Properties env)
Binds the reference to the specified remote object.
|
void |
closeConnection()
This method close the broker's connection
|
com.rabbitmq.client.Channel |
getChannel()
Return the broker's channel
|
com.rabbitmq.client.Connection |
getConnection() |
java.util.Properties |
getEnvironment() |
com.rabbitmq.client.Channel |
getNewChannel()
Creates a new channel using the Broker's connection
|
ResponseListener |
getResponseListener() |
Serializer |
getSerializer() |
<T extends Remote> |
lookup(java.lang.String reference,
java.lang.Class<T> contract)
Returns the remote object for specified reference.
|
<T extends Remote> |
lookupMulti(java.lang.String reference,
java.lang.Class<T> contract)
Returns the remote object for specified reference.
|
void |
stopBroker()
This method stops the broker's connection and all the threads created
|
void |
tryConnection(java.util.Properties env)
This function is used to send a ping message to see if the connection
works
|
void |
unbind(java.lang.String reference)
Unbinds a remoteObject from its reference and kills all the threads
created.
|
public Broker(java.util.Properties env) throws java.lang.Exception
java.lang.Exception
public void stopBroker() throws java.lang.Exception
java.lang.Exception
public com.rabbitmq.client.Connection getConnection() throws java.lang.Exception
java.lang.Exception
public void closeConnection() throws java.io.IOException
java.io.IOException
public com.rabbitmq.client.Channel getChannel() throws java.lang.Exception
java.lang.Exception
public com.rabbitmq.client.Channel getNewChannel() throws java.io.IOException
java.io.IOException
public <T extends Remote> T lookup(java.lang.String reference, java.lang.Class<T> contract) throws RemoteException
reference
- - Binding namecontract
- - Remote InterfaceRemoteException
public <T extends Remote> T lookupMulti(java.lang.String reference, java.lang.Class<T> contract) throws RemoteException
reference
- - Binding namecontract
- - Remote InterfaceRemoteException
public void bind(java.lang.String reference, RemoteObject remote) throws RemoteException, AlreadyBoundException
reference
- - Binding nameremote
- - RemoteObject to bindRemoteException
- If the remote operation failedAlreadyBoundException
- If name is already bound.public void bind(java.lang.String reference, RemoteObject remote, java.util.Properties env) throws RemoteException, AlreadyBoundException
reference
- - Binding nameremote
- - RemoteObject to bindenv
- - RemoteObject environment. You can set how many threads will
be listen to the reference, the multiqueue name and the
properties of the object queue and multiqueueRemoteException
- If the remote operation failedAlreadyBoundException
- If name is already bound.public void unbind(java.lang.String reference) throws RemoteException, java.io.IOException
reference
- - Binding nameRemoteException
- If the remote operation failedjava.io.IOException
- If there are problems while killing the threadspublic void tryConnection(java.util.Properties env) throws java.lang.Exception
env
- java.lang.Exception
public java.util.Properties getEnvironment()
public ResponseListener getResponseListener()
public Serializer getSerializer()