|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.universAAL.middleware.bus.model.AbstractBus
public abstract class AbstractBus
Defines a shared mechanisms realized by all concrete buses. This mainly means that it offers abstract view on the bus strategy and manages the bus message queue and by that reduces the implementation of the concrete bus strategy.
Field Summary | |
---|---|
protected static AALSpaceManager |
aalSpaceManager
|
protected BusStrategy |
busStrategy
|
protected static CommunicationModule |
communicationModule
|
protected ModuleContext |
context
|
protected IRegistry |
registry
|
Constructor Summary | |
---|---|
protected |
AbstractBus(ModuleContext module,
String brokerName)
|
Method Summary | |
---|---|
boolean |
addRegistryListener(IRegistryListener listener)
|
void |
brokerMessage(String senderID,
BusMessage msg)
Calls message handling in BusStrategy (gives sender ID and message to process on the bus). |
protected abstract BusStrategy |
createBusStrategy(CommunicationModule commModule)
|
protected IRegistry |
createRegistry()
|
void |
dispose()
Stops the bus (deletes all bus members from the list, stops BusStrategy thread and announces that the bus is being stopped to its members). |
String |
getBrokerName()
|
BusMember |
getBusMember(String memberID)
Returns bus member instance based on its member ID. |
String |
getBusMemberID(BusMember bm)
If the passed argument is indeed a registered member of this bus, returns the local ID with which it has been registered with the bus, otherwise null. |
BusMember[] |
getBusMembers()
|
String[] |
getBusMembersByID()
|
static int |
getCurrentNumberOfPeers()
|
PeerCard |
getPeerCard()
|
static PeerCard |
getPeerFromBusResourceURI(String uri)
|
String |
getURI()
|
boolean |
init()
|
static void |
initBrokerage(ModuleContext mc,
AALSpaceManager aalSpaceMgr,
CommunicationModule commModule)
|
boolean |
isBusResourceURI(String uri)
|
boolean |
isValidMember(String memberURI)
|
void |
messageReceived(ChannelMessage message)
Callback for the reception of messages |
String |
register(ModuleContext module,
BusMember m,
BusMemberType type)
Registers a new bus member (adds a bus member to the list of all bus members but only if it has not been added before). |
boolean |
removeRegistryListener(IRegistryListener listener)
|
BrokerMessage |
unmarshall(String serializedBusMessage)
From String to Broker Message |
void |
unregister(String memberID,
BusMember m)
Unregisters bus member from the bus (if the bus member with given ID exists). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.universAAL.middleware.modules.listener.MessageListener |
---|
handleSendError |
Field Detail |
---|
protected static AALSpaceManager aalSpaceManager
protected static CommunicationModule communicationModule
protected ModuleContext context
protected IRegistry registry
protected BusStrategy busStrategy
Constructor Detail |
---|
protected AbstractBus(ModuleContext module, String brokerName)
Method Detail |
---|
public static void initBrokerage(ModuleContext mc, AALSpaceManager aalSpaceMgr, CommunicationModule commModule)
public static int getCurrentNumberOfPeers()
public static PeerCard getPeerFromBusResourceURI(String uri)
protected IRegistry createRegistry()
protected abstract BusStrategy createBusStrategy(CommunicationModule commModule)
public BusMember getBusMember(String memberID)
memberID
- bus member ID
public String getBusMemberID(BusMember bm)
public PeerCard getPeerCard()
public BusMember[] getBusMembers()
public String[] getBusMembersByID()
public String register(ModuleContext module, BusMember m, BusMemberType type)
public void brokerMessage(String senderID, BusMessage msg)
public boolean init()
init
in interface Broker
public void dispose()
dispose
in interface Broker
public void unregister(String memberID, BusMember m)
public void messageReceived(ChannelMessage message)
MessageListener
messageReceived
in interface MessageListener
public String getBrokerName()
getBrokerName
in interface Broker
public String getURI()
public boolean isValidMember(String memberURI)
public boolean isBusResourceURI(String uri)
public BrokerMessage unmarshall(String serializedBusMessage)
Broker
unmarshall
in interface Broker
public boolean addRegistryListener(IRegistryListener listener)
public boolean removeRegistryListener(IRegistryListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |