guarana.toolkit.task.communicators
Class InCommunicator

java.lang.Object
  extended by guarana.util.observer.smart.SmartObservable
      extended by guarana.framework.task.Task
          extended by guarana.toolkit.task.communicators.Communicator
              extended by guarana.toolkit.task.communicators.InCommunicator
All Implemented Interfaces:
ISource, IStubIn, guarana.util.observer.smart.ISmartObserver, Remote

public class InCommunicator
extends Communicator
implements IStubIn

A communicator to receive messages in EntryPorts.
It provides passive and active interfaces.

Graphical notation:

Since:
Guaranį SDK 1.0.0
Author:
Rafael Z. Frantz

Field Summary
 
Fields inherited from class guarana.framework.task.Task
input, output
 
Constructor Summary
InCommunicator(String name, IEntryAdapter adapter)
          Constructs a new Active Communicator to receive message.
InCommunicator(String name, String host, int port)
          Constructs a new Passive Communicator to receive messages and exports this communicator to the RMI Registry.
 
Method Summary
 void execute()
          This method executes the business logic of this task.
 void pushRead(Message<?> message)
          This method can be invoked to push a message into an EntryPort via an In-Communicator task.
 
Methods inherited from class guarana.framework.task.Task
doWork, getName, getTriggerInterval, isTriggerTask, setName, setTriggerInterval, update
 
Methods inherited from class guarana.util.observer.smart.SmartObservable
addSmartObserver, containsSmartObserver, containsSmartObserver, countSmartObservers, deleteSmartObserver, deleteSmartObservers, hasChanged, notifySmartObservers, notifySmartObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InCommunicator

public InCommunicator(String name,
                      String host,
                      int port)
Constructs a new Passive Communicator to receive messages and exports this communicator to the RMI Registry.

Parameters:
name - The name of the communicator.
host - The host name on which the registry is running.
port - The port on which the registry accepts requests.

InCommunicator

public InCommunicator(String name,
                      IEntryAdapter adapter)
Constructs a new Active Communicator to receive message. The default trigger interval is 5000ms.

Parameters:
name - The name of the communicator.
adapter - The adapter used by the communicator.
Method Detail

execute

public void execute()
             throws TaskExecutionException
This method executes the business logic of this task. It is automatically invoked by workers.

Overrides:
execute in class Task
Throws:
TaskExecutionException - to report any exception that has occurred during the execution of this method.
See Also:
TaskExecutionException

pushRead

public void pushRead(Message<?> message)
              throws RemoteException
This method can be invoked to push a message into an EntryPort via an In-Communicator task.

Specified by:
pushRead in interface IStubIn
Parameters:
message - The inbound message.
Throws:
RemoteException - if any remote exception is raised during this method execution.
See Also:
communicator.proxy.IStubIn


Guaranį DSL Home