|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.AbstractLifeCycle fulmine.context.FulmineContext
public final class FulmineContext
The default IFrameworkContext
implementation composed of
collaborating implementations:
This is created with a DefaultPermissionProfile
. By default, all
remote container updates are vetoed using an internal
VetoingRemoteUpdateHandler
, this can be replaced using an appropriate
handler via setRemoteUpdateHandler(IRemoteUpdateHandler)
.
Nested Class Summary | |
---|---|
static interface |
FulmineContext.SystemInfoFields
Encapsulates the field names for the system info record |
Field Summary |
---|
Fields inherited from interface fulmine.context.IFrameworkContext |
---|
NAME |
Fields inherited from interface fulmine.rpc.IRpcManager |
---|
DEFAULT_RPC_TIMEOUT, RPC_TIMEOUT |
Constructor Summary | |
---|---|
FulmineContext(String identity)
Construct a context with an identity. |
|
FulmineContext(String identity,
int processors)
Construct a context with an identity and the number of processors. |
|
FulmineContext(String identity,
String eventProcessorIdentityPrefix)
Construct a context with an identity and the prefix for the name for the event processors. |
|
FulmineContext(String identity,
String eventProcessorIdentityPrefix,
int processors)
Construct a context with an identity, the prefix for the name for the event processors and the number of processors. |
Method Summary | |
---|---|
void |
addContainer(IContainer container)
Add a container to this context. |
boolean |
addRpcPublicationListener(String remoteContextIdentity,
IRpcPublicationListener listener)
Add a listener for RPC publication events. |
boolean |
addSubscriptionListener(ISubscriptionListener listener)
Add a container subscription listener. |
boolean |
containsLocalContainer(String containerIdentity,
IType type,
IDomain domain)
Identify if the local container exists in this context |
boolean |
containsRemoteContainer(String remoteContextIdentity,
String containerIdentity,
IType type,
IDomain domain)
Identify if the remote container exists in this context |
protected void |
doDestroy()
Overridden in subclasses to perform custom logic on destruction. |
protected void |
doStart()
Overridden in subclasses to perform custom logic on activation. |
boolean |
equals(Object obj)
|
void |
execute(Runnable task)
Add the task to a queue to be executed by a single worker thread. |
IChannel[] |
getConnectedChannels()
Get all the currently connected channels |
IConnectionBroker |
getConnectionBroker()
Get the connection broker for the context. |
IConnectionDiscoverer |
getConnectionDiscoverer()
Get the connection discoverer in use by this context. |
IContainerFactory |
getContainerFactory()
Get the container factory for the context. |
int |
getContextHashCode()
Get a unique integer for this context. |
IContextWatchdog |
getContextWatchdog()
Get the component that will report on the state of this context |
IDistributionManager |
getDistributionManager()
Get the distribution manager assigned to the context |
protected IEventManager |
getEventManager()
|
int |
getEventProcessorCount()
Get the number of EventProcessor instances in this context |
String |
getEventProcessorIdentityPrefix()
Get the event processor identity prefix. |
ThreadGroup |
getEventProcessorThreadGroup()
Get the ThreadGroup for the event processors. |
IFrameReader |
getFrameReader()
Get the frame reader for this context |
IFrameWriter |
getFrameWriter()
Get the frame writer for this context |
String |
getIdentity()
Get the unique identity of this context. |
IContainer |
getLocalContainer(String identity,
IType type,
IDomain domain)
Get the identified local container. |
Collection<IContainer> |
getLocalContainers()
Get a copy of the collection of local containers in this context. |
protected AsyncLog |
getLog()
Get the log to use for the object hierarchy |
protected IModelManager |
getModelManager()
|
INetwork |
getNetwork()
Get the network |
IPermissionProfile |
getPermissionProfile()
Get the permission profile for the context. |
IContainer |
getRemoteContainer(String remoteContextIdentity,
String containerIdentity,
IType type,
IDomain domain)
Get the identified remote container. |
Collection<IContainer> |
getRemoteContainers(String remoteContextIdentity)
Get a copy of the collection of remote containers in this context. |
ISystemEventSource |
getSystemEventSource(Class<? extends ISystemEvent> type)
Get an ISystemEventSource that is used to propagate a single
specific type of ISystemEvent . |
IContainer |
getSystemInfo()
Get the 'system info' record that is used to encapsulate any system level information about the context. |
int |
hashCode()
|
IRpcMarker |
invoke(IRpcResultHandler resultHandler,
String remoteContextIdentity,
String procedure,
IField... args)
Asynchronously invoke the RPC in the named remote context. |
IRpcResult |
invoke(String remoteContextIdentity,
String procedure,
IField... args)
Synchronously invoke the RPC in the named remote context. |
void |
invokeRpc(String remoteContextIdentity,
byte[] rpcData)
Send the RPC invocation to the remote context. |
boolean |
publishProdedure(IRpcHandler handler,
IRpcDefinition rpcDefinition)
Publish the named procedure to all known remote contexts. |
boolean |
publishRpcs(Class<?> definition,
Object handler)
Allows application code to remotely enable all methods in a handler object that are implementations of methods in an interface definition. |
void |
queueEvent(IEvent event)
Add the event to a queue for distribution to registered IEventListener instances for the event's IEventSource . |
void |
queueEvents(Collection<IEvent> events)
Bulk operation for queueing events. |
boolean |
removeContainer(IContainer container)
Remove a container from the context. |
boolean |
removeRpcPublicationListener(String remoteContextIdentity,
IRpcPublicationListener listener)
Remove an RPC publication listener. |
boolean |
removeSubscriptionListener(ISubscriptionListener listener)
Remove a container subscription listener. |
void |
requestRetransmit(String contextIdentity,
String identityRegularExpression,
IType type,
IDomain domain)
Send a request to the named remote context to retransmit the complete state of the IContainer instances with matching type and identity
subscribe for by the local context. |
void |
requestRetransmitAll(String contextIdentity)
Send a request to the named remote context to retransmit the complete state of all IContainer instances subscribed for by the local
context. |
void |
retransmit(String contextIdentity,
String identityRegularExpression,
IType type,
IDomain domain)
Retransmit the complete state of the IContainer instances with
matching type and identity to the (connected) remote context. |
void |
retransmitAll(String contextIdentity)
Retransmit the complete state of all the IContainer instances
that the (connected) remote context has subscribed for. |
void |
retransmitAllToAll()
Retransmit the complete state of all the IContainer instances to
all (connected) remote contexts that have a subscription for the
container instances. |
void |
retransmitToAll(String identityRegularExpression,
IType type,
IDomain domain)
Retransmit the complete state of the IContainer instances with
matching type and identity to all (connected) remote contexts that have a
subscription for the matching container. |
void |
schedule(TimerTask task,
long delay,
long period)
Schedule a timer task to be executed by a single worker thread. |
void |
setConnectionBroker(IConnectionBroker broker)
Set the connection broker for the context. |
void |
setConnectionDiscoverer(IConnectionDiscoverer discoverer)
Set the discover for the context. |
void |
setContextWatchdog(IContextWatchdog watchdog)
Set the component that will report on the state of this context |
void |
setDistributionManager(IDistributionManager distributionManager)
Provide a different implementation of the distribution manager. |
void |
setNetwork(INetwork network)
Set the INetwork for the context. |
void |
setPermissionProfile(IPermissionProfile permissionProfile)
Set the permission profile for the context. |
void |
setRemoteUpdateHandler(IRemoteUpdateHandler handler)
Set the object that will handle updates to local records from remote contexts via RPC calls. |
boolean |
subscribe(String contextIdentity,
String identityPattern,
IType type,
IDomain domain,
IEventListener listener)
Subscribe the listener for the events generated by the IContainer
instance(s) in the identified context that match the type, domain and
identity regular expression. |
String |
toString()
|
boolean |
unpublishProdedure(IRpcDefinition rpcDefinition)
Unpublish the procedure from all connected remote contexts. |
boolean |
unpublishRpcs(Class<?> definition,
Object handler)
Allows application code to remove any previously remotely enabled methods published via IRpcPublishOperations.publishRpcs(Class, Object) |
boolean |
unsubscribe(String contextIdentity,
String identityPattern,
IType type,
IDomain domain,
IEventListener listener)
Unsubscribe the listener from the IContainer instance(s)
identified by the type, domain and identity regular expression in the
specified context. |
String |
updateRemoteContainer(String remoteContextIdentity,
String identity,
IType type,
IDomain domain,
String fieldName,
String fieldValueAsString)
Update a named field with a new value in a container in a remote context. |
Methods inherited from class fulmine.AbstractLifeCycle |
---|
checkActive, destroy, finalize, isActive, start |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface fulmine.context.IFulmineContext |
---|
start |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Constructor Detail |
---|
public FulmineContext(String identity)
This version checks the system runtime for the number of processors and
will use that number + 1 when constructing the EventManager
.
identity
- the context's identitypublic FulmineContext(String identity, int processors)
identity
- the context's identityprocessors
- the number of processors available for eventspublic FulmineContext(String identity, String eventProcessorIdentityPrefix)
This version checks the system runtime for the number of processors and
will use that number + 1 when constructing the EventManager
.
identity
- the context's identityeventProcessorIdentityPrefix
- the prefix for the name for the event processorspublic FulmineContext(String identity, String eventProcessorIdentityPrefix, int processors)
identity
- the context's identityeventProcessorIdentityPrefix
- the prefix for the name for the event processorsprocessors
- the number of processors available for eventsMethod Detail |
---|
public IContextWatchdog getContextWatchdog()
IFrameworkContext
getContextWatchdog
in interface IFrameworkContext
public void setContextWatchdog(IContextWatchdog watchdog)
IFulmineContext
setContextWatchdog
in interface IFulmineContext
watchdog
- a component that can report on the state of this contextprotected IModelManager getModelManager()
protected IEventManager getEventManager()
public void setDistributionManager(IDistributionManager distributionManager)
setDistributionManager
in interface IFrameworkContext
distributionManager
- the distribution manager to usepublic IDistributionManager getDistributionManager()
IFrameworkContext
getDistributionManager
in interface IFrameworkContext
public IPermissionProfile getPermissionProfile()
IFulmineContext
IField
s that this context is allowed to view. If a profile has
not been set by application code, a default one should be provided.
getPermissionProfile
in interface IFulmineContext
public void setPermissionProfile(IPermissionProfile permissionProfile)
IFulmineContext
IField
s that this context will be allowed to view.
setPermissionProfile
in interface IFulmineContext
permissionProfile
- the permission profileprotected void doStart()
AbstractLifeCycle
RuntimeException
or subclass
thereof. When this method is called, the AbstractLifeCycle.isActive()
method will
return true
.
doStart
in class AbstractLifeCycle
protected void doDestroy()
AbstractLifeCycle
RuntimeException
or subclass
thereof.
doDestroy
in class AbstractLifeCycle
public void addContainer(IContainer container)
IModelManager
addContainer
in interface IModelManager
container
- the container to add to this contextpublic String getIdentity()
IFulmineContext
getIdentity
in interface IFulmineContext
public void setNetwork(INetwork network)
IFulmineContext
INetwork
for the context. This allows the context to
communicate with other contexts that use the same network transport. This
must be called before IFulmineContext.start()
.
setNetwork
in interface IFulmineContext
network
- the networkpublic INetwork getNetwork()
IFrameworkContext
getNetwork
in interface IFrameworkContext
public IContainer getLocalContainer(String identity, IType type, IDomain domain)
IModelManager
ContainerFactory
.
If the ContainerFactory
does not have a
IContainerFactory.IContainerBuilder
registered for the type
argument, a standard container is created.
This operation does not support any wildcards for the attributes (it
does not have the same contract for the identity, type and domain as
IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener)
.
getLocalContainer
in interface IModelManager
identity
- the identity of the local containertype
- the type of the local containerdomain
- the domain of the local container
IContainer
native to this context and hosted in this
contextpublic IContainer getRemoteContainer(String remoteContextIdentity, String containerIdentity, IType type, IDomain domain)
IModelManager
ContainerFactory
and its state is set to be
IContainer#STALE
until it receives an update.
This method just creates the 'proxy shell' for the remote events to be
applied to. Use the
IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener)
method to start receiving events for the container.
This operation does not support any wildcards for the attributes (it
does not have the same contract for the identity, type and domain as
IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener)
.
getRemoteContainer
in interface IModelManager
remoteContextIdentity
- the identity of the remote context where the remote container
originates from - this is only required if the remote
container will be created. Use
IModelManager.containsRemoteContainer(String, String, IType, IDomain)
to determine if the remote container exists.type
- the type of the remote containerdomain
- the domain of the remote container
IContainer
native to the specified remote context and
hosted in this contextpublic boolean containsRemoteContainer(String remoteContextIdentity, String containerIdentity, IType type, IDomain domain)
IModelManager
containsRemoteContainer
in interface IModelManager
remoteContextIdentity
- the identity of the remote context where the remote container
originated fromtype
- the type of the container to finddomain
- the domain of the container
true
if the remote container existspublic boolean containsLocalContainer(String containerIdentity, IType type, IDomain domain)
IModelManager
containsLocalContainer
in interface IModelManager
type
- the type of the container to finddomain
- the domain of the container
true
if the local container existspublic void queueEvent(IEvent event)
IEventManager
IEventListener
instances for the event's IEventSource
.
queueEvent
in interface IEventManager
event
- the event to queuepublic void queueEvents(Collection<IEvent> events)
IEventManager
queueEvents
in interface IEventManager
IEventManager.queueEvent(IEvent)
public boolean removeContainer(IContainer container)
IModelManager
removeContainer
in interface IModelManager
container
- the container to remove
true
if the container was removed,
false
if the container was not foundpublic boolean subscribe(String contextIdentity, String identityPattern, IType type, IDomain domain, IEventListener listener)
IDistributionManager
IContainer
instance(s) in the identified context that match the type, domain and
identity regular expression. The supplied listener will be registered
against the matching container instance(s). Events (changes to the
container instance(s)) will be received by the listener.
The container type and domain is matched exactly. However, a 'wildcard'
match for the type or domain can be specified using
ISubscription.WILDCARD_TYPE
and
ISubscription.WILDCARD_DOMAIN
. The identity regular expression
can identify an exact container identity or it can identify multiple
container identities (it is a regular expression matched against
container identities).
All subscription operations occur indefinitely; the operation examines
all current containers and then future created containers for an identity
match. The listener is registered against any matching container. The
subscription exists until either the context terminates or the
IDistributionManager.unsubscribe(String, String, IType, IDomain, IEventListener)
method is invoked with the same arguments. Using a regular expression
matching subscription allows a listener to receive updates for containers
whose identities are currently unknown or do not yet exist.
When the subscription is for a remote context (the contextIdentity does not match the local context identity), the subscription request is transmitted to the named remote context. The remote context handles the subscription using the same contract as for a local subscription. If the remote context has not yet come online, the subscription is saved until the identified remote context becomes available, at which point the subscription is transmitted.
Calling this method multiple times with the same arguments has no effect; it is idempotent.
subscribe
in interface IDistributionManager
contextIdentity
- the identity of context where the container(s) existidentityPattern
- the identity regular expression that will be matched against a
container's identitytype
- the type of the containerdomain
- the domain of the containerlistener
- the listener that will be registered for receiving events from
the matching container(s)
true
if the subscription was created,
false
if it already existedIDistributionManager.unsubscribe(String, String, IType, IDomain, IEventListener)
public boolean unsubscribe(String contextIdentity, String identityPattern, IType type, IDomain domain, IEventListener listener)
IDistributionManager
IContainer
instance(s)
identified by the type, domain and identity regular expression in the
specified context.
The IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener)
method is idempotent so if it is called multiple times with the
same arguments, one call to
IDistributionManager.unsubscribe(String, String, IType, IDomain, IEventListener)
will
remove it.
Two subscriptions with equal type and domain but identity "foo.*" and "foo" are separate subscriptions and require two unsubscribe operations; the unsubscribe for "foo.*" does not unsubscribe the "foo" subscription.
unsubscribe
in interface IDistributionManager
contextIdentity
- the identity of the remote contextidentityPattern
- the identity regular expression that will be matched against a
container's identitytype
- the type of the containerdomain
- the domain of the containerlistener
- the listener that will be unregistered from receiving events
from matching container(s)
true
if the subscription was found and removed,
false
otherwiseIDistributionManager.subscribe(String, String, IType, IDomain, IEventListener)
public IChannel[] getConnectedChannels()
IDistributionManager
getConnectedChannels
in interface IDistributionManager
IChannel
instancespublic int getEventProcessorCount()
IEventManager
EventProcessor
instances in this context
getEventProcessorCount
in interface IEventManager
public Collection<IContainer> getLocalContainers()
IModelManager
getLocalContainers
in interface IModelManager
public Collection<IContainer> getRemoteContainers(String remoteContextIdentity)
IModelManager
getRemoteContainers
in interface IModelManager
remoteContextIdentity
- the remote context identity that the remote containers
originated from
public ThreadGroup getEventProcessorThreadGroup()
IEventManager
ThreadGroup
for the event processors.
getEventProcessorThreadGroup
in interface IEventManager
public IConnectionBroker getConnectionBroker()
IFrameworkContext
getConnectionBroker
in interface IFrameworkContext
null
if there is no
broker in the contextIFrameworkContext.setConnectionBroker(IConnectionBroker)
public void setConnectionBroker(IConnectionBroker broker)
IFrameworkContext
IFulmineContext.start()
.
setConnectionBroker
in interface IFrameworkContext
broker
- the broker to use to create connections to remote contextspublic IConnectionDiscoverer getConnectionDiscoverer()
IFrameworkContext
getConnectionDiscoverer
in interface IFrameworkContext
null
if there is
not one allocated.public void setConnectionDiscoverer(IConnectionDiscoverer discoverer)
IFrameworkContext
IFulmineContext.start()
.
setConnectionDiscoverer
in interface IFrameworkContext
discoverer
- the discoverer to use to find connections to other remote
contextspublic IContainerFactory getContainerFactory()
IModelManager
getContainerFactory
in interface IModelManager
public ISystemEventSource getSystemEventSource(Class<? extends ISystemEvent> type)
IEventManager
ISystemEventSource
that is used to propagate a single
specific type of ISystemEvent
. The system event source will be
created on the first invocation. The system event source is associated
with the zeroth EventProcessor
.
getSystemEventSource
in interface IEventManager
type
- the type of the system events the system event source
generates
ISystemEventSource
for the type of system eventpublic void execute(Runnable task)
IEventManager
execute
in interface IEventManager
public IFrameReader getFrameReader()
IDistributionManager
getFrameReader
in interface IDistributionManager
IFrameReader
for this contextpublic IFrameWriter getFrameWriter()
IDistributionManager
getFrameWriter
in interface IDistributionManager
IFrameWriter
for this contextpublic void requestRetransmit(String contextIdentity, String identityRegularExpression, IType type, IDomain domain)
IRetransmissionManager
IContainer
instances with matching type and identity
subscribe for by the local context.
requestRetransmit
in interface IRetransmissionManager
contextIdentity
- the identity of the remote contextidentityRegularExpression
- the identity regular expression to match against containers
currently subscribed for by the local contexttype
- the type of the containerdomain
- the domain of the containerpublic void requestRetransmitAll(String contextIdentity)
IRetransmissionManager
IContainer
instances subscribed for by the local
context.
requestRetransmitAll
in interface IRetransmissionManager
contextIdentity
- the identity of the remote contextpublic void retransmit(String contextIdentity, String identityRegularExpression, IType type, IDomain domain)
IRetransmissionManager
IContainer
instances with
matching type and identity to the (connected) remote context. The
container must also currently be subscribed for by the remote context.
retransmit
in interface IRetransmissionManager
contextIdentity
- the identity of the remote contextidentityRegularExpression
- the identity regular expression to match against containers
currently subscribed for by the remote contexttype
- the type of the containerdomain
- the domain of the containerpublic void retransmitAll(String contextIdentity)
IRetransmissionManager
IContainer
instances
that the (connected) remote context has subscribed for.
retransmitAll
in interface IRetransmissionManager
contextIdentity
- the identity of the remote contextpublic void retransmitAllToAll()
IRetransmissionManager
IContainer
instances to
all (connected) remote contexts that have a subscription for the
container instances.
retransmitAllToAll
in interface IRetransmissionManager
public void retransmitToAll(String identityRegularExpression, IType type, IDomain domain)
IRetransmissionManager
IContainer
instances with
matching type and identity to all (connected) remote contexts that have a
subscription for the matching container.
retransmitToAll
in interface IRetransmissionManager
identityRegularExpression
- the identity regular expression to match against containers
currently subscribed for by any (connected) remote contexts.type
- the type of the containerdomain
- the domain of the containerpublic boolean addSubscriptionListener(ISubscriptionListener listener)
IDistributionManager
The listener will be added to a list only if it does not already exist in the list. Subscription events will be notified to all listeners in the list in the order they are added.
addSubscriptionListener
in interface IDistributionManager
listener
- a listener to add to an internal list.
true
if the listener was added, false
otherwisepublic boolean removeSubscriptionListener(ISubscriptionListener listener)
IDistributionManager
removeSubscriptionListener
in interface IDistributionManager
listener
- the listener to remove
true
if the listener was found and removed,
false
otherwisepublic int getContextHashCode()
IFulmineContext
getContextHashCode
in interface IFulmineContext
public String getEventProcessorIdentityPrefix()
IFrameworkContext
getEventProcessorIdentityPrefix
in interface IFrameworkContext
public void invokeRpc(String remoteContextIdentity, byte[] rpcData)
IRpcTransmissionManager
invokeRpc
in interface IRpcTransmissionManager
remoteContextIdentity
- the identity of the remote context that the RPC should be sent
torpcData
- the RPC in its byte[] formIRpcManager
public boolean addRpcPublicationListener(String remoteContextIdentity, IRpcPublicationListener listener)
IRpcManager
This is an idempotent operation.
addRpcPublicationListener
in interface IRpcManager
remoteContextIdentity
- the remote context to monitor for RPC publish/unpublish eventslistener
- a listener to receive the RPC publish/unpublish events.
true
if the listener was added, false
otherwisepublic IRpcMarker invoke(IRpcResultHandler resultHandler, String remoteContextIdentity, String procedure, IField... args)
IRpcManager
IRpcPublicationListener
invoke
in interface IRpcManager
resultHandler
- the handler to process the asynchronous resultremoteContextIdentity
- the remote context to invoke the RPC inprocedure
- the RPC nameargs
- the arguments for the RPC
public IRpcResult invoke(String remoteContextIdentity, String procedure, IField... args)
IRpcManager
It is assumed that this method is called after an RPC publication event
is received by an IRpcPublicationListener
.
invoke
in interface IRpcManager
remoteContextIdentity
- the remote context to invoke the RPC inprocedure
- the RPC nameargs
- the arguments for the RPC
IRpcManager.RPC_TIMEOUT
public boolean publishProdedure(IRpcHandler handler, IRpcDefinition rpcDefinition)
IRpcPublishOperations
There can only be one handler per procedure instance. Different handlers can be used for overloaded procedures. RPC definitions cannot overload the result type, if this method is called with a definition that attempts to overload the result type, the operation is ignored and no publish happens.
After this method has completed, remote contexts will be able to invoke the RPC.
publishProdedure
in interface IRpcPublishOperations
handler
- the object that will handle any RPC invocations for this RPC
definition. This object must be thread safe.rpcDefinition
- the RPC definition
true
if the procedure was published,
false
if has already been publishedpublic boolean unpublishProdedure(IRpcDefinition rpcDefinition)
IRpcPublishOperations
unpublishProdedure
in interface IRpcPublishOperations
rpcDefinition
- the RPC definition to unpublish
true
if the procedure was unpublishedpublic boolean unpublishRpcs(Class<?> definition, Object handler)
IRpcPublishOperations
IRpcPublishOperations.publishRpcs(Class, Object)
unpublishRpcs
in interface IRpcPublishOperations
definition
- an interface that defines all the methods in the handler that
should be remotely disabled. This includes all methods in the
super-interfaces, if any.handler
- the object that implements the methods declared in the
definition interface. These methods will no longer be
available for remote invocation.
true
if all methods were successfully unpublishedpublic boolean publishRpcs(Class<?> definition, Object handler)
IRpcPublishOperations
There are some caveats to methods that can be remotely enabled; the method arguments and return types must be scalar and only the following types are supported:
This is a convenience method in-lieu of calling
IRpcPublishOperations.publishProdedure(IRpcHandler, IRpcDefinition)
.
publishRpcs
in interface IRpcPublishOperations
definition
- an interface that defines all the methods in the handler that
should be remotely enabled. This includes all methods in the
super-interfaces, if any.handler
- the object that implements the methods declared in the
definition interface. The handler does not necessarily have to
be an instance of the interface (i.e. does not need to
explicitly implement the interface, it only needs to implement
all the methods). All remote invocations of these methods will
be handled by this object. The remotely enabled methods
must be thread safe.
true
if all methods were successfully publishedpublic boolean removeRpcPublicationListener(String remoteContextIdentity, IRpcPublicationListener listener)
IRpcManager
This is an idempotent operation.
removeRpcPublicationListener
in interface IRpcManager
remoteContextIdentity
- the remote context that the listener was monitoring for RPC
publish/unpublish eventslistener
- the listener to remove
true
if the listener was found and removed,
false
otherwisepublic void setRemoteUpdateHandler(IRemoteUpdateHandler handler)
IFulmineContext
setRemoteUpdateHandler
in interface IFulmineContext
handler
- the handler to useIDistributionManager.updateRemoteContainer(String, String, IType,
IDomain, String, String)
protected AsyncLog getLog()
AbstractLifeCycle
getLog
in class AbstractLifeCycle
public final String toString()
toString
in class AbstractLifeCycle
public final boolean equals(Object obj)
equals
in class Object
public final int hashCode()
hashCode
in class Object
public String updateRemoteContainer(String remoteContextIdentity, String identity, IType type, IDomain domain, String fieldName, String fieldValueAsString)
IDistributionManager
Note: This operation may be synchronous and may therefore block on I/O.
updateRemoteContainer
in interface IDistributionManager
remoteContextIdentity
- the identity of the remote context where the container is
hostedidentity
- the identity of the container with the field to changetype
- the type of the containerdomain
- the domain of the containerfieldName
- the field name in the container to updatefieldValueAsString
- the field value (as a string) to set as the new value for the
named field
#setRemoteUpdateHandler(IRemoteUpdateHandler)
public IContainer getSystemInfo()
IFrameworkContext
Bespoke attributes can be attached to this record by application code.
getSystemInfo
in interface IFrameworkContext
public void schedule(TimerTask task, long delay, long period)
IEventManager
schedule
in interface IEventManager
task
- task to be scheduled.delay
- delay in milliseconds before task is to be executed.period
- time in milliseconds between successive task executions.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |