flux.agent
Class AgentFactory

java.lang.Object
  extended byflux.agent.AgentFactory

public abstract class AgentFactory
extends java.lang.Object

Makes Flux agents, which cooperate with Flux engines to distribute workloads across many computers.

Author:
Copyright 2000-2008 Flux Corporation. All rights reserved.

Constructor Summary
AgentFactory()
           
 
Method Summary
abstract  Agent lookupAgent(java.lang.String host, int port, java.lang.String bindName)
          Looks up a remote Flux agent using the specified host, port, and bind name.
abstract  Agent makeAgent(AgentConfiguration configuration)
          Makes a new Flux agent.
abstract  AgentConfiguration makeAgentConfiguration()
          Makes a new agent configuration.
abstract  AgentConfiguration makeAgentConfiguration(java.io.InputStream propertiesInputStream)
          Makes a new agent configuration using the supplied agent configuration input stream.
abstract  AgentConfiguration makeAgentConfiguration(java.util.Properties properties)
          Makes a new agent configuration using the supplied agent configuration properties.
abstract  AgentConfiguration makeAgentConfiguration(java.lang.String propertiesFile)
          Makes a new agent configuration using the supplied agent configuration file.
static AgentFactory makeInstance()
          Makes a new agent factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentFactory

public AgentFactory()
Method Detail

lookupAgent

public abstract Agent lookupAgent(java.lang.String host,
                                  int port,
                                  java.lang.String bindName)
                           throws java.rmi.NotBoundException,
                                  java.rmi.RemoteException
Looks up a remote Flux agent using the specified host, port, and bind name.

Parameters:
host - The remote computer to contact.
port - The RMI registry port.
bindName - The name to which the agent is bound in the RMI registry.
Returns:
A remote reference to a remote Flux agent.
Throws:
java.rmi.NotBoundException - If the specified RMI registry bind name does not exist.
java.rmi.RemoteException - If a networking error occurs.

makeAgent

public abstract Agent makeAgent(AgentConfiguration configuration)
                         throws AgentException,
                                java.rmi.RemoteException
Makes a new Flux agent. The fresly created agent attempts to register with its configured master Flux engine. When a connection to a Flux engine cannot be established or is lost, the agent automatically attempts to reestablish the connection. These reconnection attempts are performed automatically and do not cause remote exceptions to be thrown.

During the creation process, the new Flux agent attempts to locate an RMI registry. Once located, the new agent attempts to bind itself to that RMI registry. If a process is listening on the configured registry port but binding fails, a remote exception is thrown.

If no process is listening on the configured registry port, an attempt is made to create a new RMI registry and bind to it. If this procedure fails, a remote exception is thrown.

Returns:
A freshly made Flux agent.
Throws:
AgentException - If the agent configuration is invalid.
java.rmi.RemoteException - If the new Flux agent cannot be bound to an RMI registry.

makeAgentConfiguration

public abstract AgentConfiguration makeAgentConfiguration()
Makes a new agent configuration.

Returns:
A freshly make agent configuration.

makeAgentConfiguration

public abstract AgentConfiguration makeAgentConfiguration(java.io.InputStream propertiesInputStream)
                                                   throws AgentException
Makes a new agent configuration using the supplied agent configuration input stream. The input stream will not be closed.

Parameters:
propertiesInputStream - A specification of how to make an agent. The input stream will not be closed.
Returns:
A freshly made agent configuration based on a properties input stream.
Throws:
AgentException - If a system error occurs.

makeAgentConfiguration

public abstract AgentConfiguration makeAgentConfiguration(java.util.Properties properties)
                                                   throws AgentException
Makes a new agent configuration using the supplied agent configuration properties.

Parameters:
properties - A specification of how to make an agent.
Returns:
A freshly made agent configuration based on a properties object.
Throws:
AgentException - If a system error occurs.
java.lang.IllegalArgumentException - If the specified properties object is null.

makeAgentConfiguration

public abstract AgentConfiguration makeAgentConfiguration(java.lang.String propertiesFile)
                                                   throws AgentException
Makes a new agent configuration using the supplied agent configuration file.

Parameters:
propertiesFile - A specification of how to make an agent.
Returns:
A freshly made agent configuration based on a properties file.
Throws:
AgentException - If a system error occurs.

makeInstance

public static AgentFactory makeInstance()
Makes a new agent factory.

Returns:
A freshly made agent factory.


© 2000-2008 Flux Corporation. All rights reserved.