org.universAAL.middleware.context.impl
Class ContextBusImpl

Package class diagram package ContextBusImpl
java.lang.Object
  extended by org.universAAL.middleware.bus.model.AbstractBus
      extended by org.universAAL.middleware.context.impl.ContextBusImpl
All Implemented Interfaces:
Broker, ContextBus, MessageListener

public class ContextBusImpl
extends AbstractBus
implements ContextBus

Author:
mtazari - Saied Tazari

Field Summary
 
Fields inherited from class org.universAAL.middleware.bus.model.AbstractBus
aalSpaceManager, busStrategy, communicationModule, context, registry
 
Method Summary
 void addNewRegParams(String memberID, ContextEventPattern[] registrParams)
          Allows the members of the context bus to provide registration parameters; for the meaning of the provided "registration parameters" see the explanation for the input parameter registrParams.
 void assessContentSerialization(Resource content)
           
 void brokerContextEvent(String publisherID, ContextEvent msg)
          Send a Context Event through the Context Bus
protected  BusStrategy createBusStrategy(CommunicationModule commModule)
           
 ContextEventPattern[] getAllProvisions(String publisherID)
          Returns all provisions registered by all ContextPublishers on all instances of this bus in the current AAL Space.
static Object[] getContextBusFetchParams()
           
 void handleSendError(ChannelMessage message, CommunicationConnectorException e)
          Callback for error handling
 void removeMatchingRegParams(String memberID, ContextEventPattern[] oldRegistrParams)
          Removes registration parameters introduced previously through ContextBus.addNewRegParams(String, ContextEventPattern[]).
static void startModule(Container c, ModuleContext mc, Object[] contextBusShareParams, Object[] contextBusFetchParams)
           
static void stopModule()
           
 void unregister(String memberID, BusMember m)
          Unregisters bus member from the bus (if the bus member with given ID exists).
 void unregister(String publisherID, ContextPublisher publisher)
          Unregister a Context Publisher from the Context Bus
 void unregister(String subscriberID, ContextSubscriber subscriber)
          Unregister a Context Subscriber from the Context Bus
 
Methods inherited from class org.universAAL.middleware.bus.model.AbstractBus
addRegistryListener, brokerMessage, createRegistry, dispose, getBrokerName, getBusMember, getBusMemberID, getBusMembers, getBusMembersByID, getCurrentNumberOfPeers, getPeerCard, getPeerFromBusResourceURI, getURI, init, initBrokerage, isBusResourceURI, isValidMember, messageReceived, register, removeRegistryListener, unmarshall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContextBusFetchParams

public static Object[] getContextBusFetchParams()

assessContentSerialization

public void assessContentSerialization(Resource content)

startModule

public static void startModule(Container c,
                               ModuleContext mc,
                               Object[] contextBusShareParams,
                               Object[] contextBusFetchParams)

stopModule

public static void stopModule()

createBusStrategy

protected BusStrategy createBusStrategy(CommunicationModule commModule)
Specified by:
createBusStrategy in class AbstractBus

addNewRegParams

public void addNewRegParams(String memberID,
                            ContextEventPattern[] registrParams)
Description copied from interface: ContextBus
Allows the members of the context bus to provide registration parameters; for the meaning of the provided "registration parameters" see the explanation for the input parameter registrParams.

Specified by:
addNewRegParams in interface ContextBus
Parameters:
memberID - The ID of the subscriber or publisher registered to the context bus
registrParams - If the memberID refers to a context subscriber, registrParams will be interpreted as the patterns of the context events to which the subscriber wants to subscribe, and if the memberID refers to a context publisher, it will be interpreted as the patterns of the context events that the publisher will publish

getAllProvisions

public ContextEventPattern[] getAllProvisions(String publisherID)
Description copied from interface: ContextBus
Returns all provisions registered by all ContextPublishers on all instances of this bus in the current AAL Space. Only ContextPublishers are allowed to call this method, hence they must provide their member-ID so that the bus can check this.

Specified by:
getAllProvisions in interface ContextBus

removeMatchingRegParams

public void removeMatchingRegParams(String memberID,
                                    ContextEventPattern[] oldRegistrParams)
Description copied from interface: ContextBus
Removes registration parameters introduced previously through ContextBus.addNewRegParams(String, ContextEventPattern[]).

Specified by:
removeMatchingRegParams in interface ContextBus

brokerContextEvent

public void brokerContextEvent(String publisherID,
                               ContextEvent msg)
Description copied from interface: ContextBus
Send a Context Event through the Context Bus

Specified by:
brokerContextEvent in interface ContextBus
Parameters:
publisherID - ID of the Publisher registered to the context bus
msg - Context Event to forward through the bus

unregister

public void unregister(String publisherID,
                       ContextPublisher publisher)
Description copied from interface: ContextBus
Unregister a Context Publisher from the Context Bus

Specified by:
unregister in interface ContextBus
Parameters:
publisherID - ID of the Publisher registered to the context bus
publisher - The Publisher to unregister.

unregister

public void unregister(String subscriberID,
                       ContextSubscriber subscriber)
Description copied from interface: ContextBus
Unregister a Context Subscriber from the Context Bus

Specified by:
unregister in interface ContextBus
Parameters:
subscriberID - ID of the Subscriber registered to the context bus
subscriber - The Subscriber to unregister.

unregister

public void unregister(String memberID,
                       BusMember m)
Description copied from class: AbstractBus
Unregisters bus member from the bus (if the bus member with given ID exists).

Overrides:
unregister in class AbstractBus

handleSendError

public void handleSendError(ChannelMessage message,
                            CommunicationConnectorException e)
Description copied from interface: MessageListener
Callback for error handling

Specified by:
handleSendError in interface MessageListener


Copyright © 2014 universAAL Consortium. All Rights Reserved.