Package jade.core
Class Profile
- java.lang.Object
-
- jade.core.Profile
-
- Direct Known Subclasses:
ProfileImpl
public abstract class Profile extends Object
This class allows retrieving configuration-dependent classes.- Version:
- 1.0, 22/11/00
- Author:
- Federico Bergenti, Giovanni Caire - TILAB
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCEPT_FOREIGN_AGENTSThis constant is the key of the property whose value (true or false) indicates whether or not this platform accepts foreign agents i.e.static StringACLCODECSThis constant is the key of the property whose value contains the list of ACLCODECSs that have to be launched at bootstrap time.static StringAGENT_TAGThis constant is the key of the property whose value will substitute the %A wildcard in names of all agents that will start in the local container.static StringAGENTSThis constant is the name of the property whose value contains the list of agents that have to be launched at bootstrap timestatic StringANDROIDstatic StringCONTAINER_NAMEThis constant is the key of the property whose value contains the desired name of the container.static intDEFAULT_PORTstatic StringDEFAULT_SERVICESstatic StringDEFAULT_SERVICES_NOMOBILITYstatic StringDETECT_MAINThis constant is the name of the property whose Boolean value tells whether to activate the automatic main container detection mechanism.static StringDUMP_OPTIONSThis constant is the name of the property whose Boolean value tells whether startup options should be dumped.static StringEXPORT_HOSTThis constant is the name or address of the host that other containers will have to use to contact this containerstatic StringEXPORT_PORTThis constant is the port that other containers will have to use to contact this containerstatic StringFILE_DIRThis constant is the key of the property whose value contains the name of the directory where all the files generated by JADE should be put.static StringGUIstatic StringIMTPThis constant is the key of the property whose value identifies the IMTP Manager to be created by ProfileImplstatic StringIP_VERSIONThis constant is the key of the property whose value contains the version of IP address to use.static intIPV4static intIPV6static StringJ2SEstatic StringJVMThis constant is the key of the property whose value contains the indication about the type of JVM.static StringLEAP_IMTPstatic StringLOCAL_HOSTThis constant is the name of the property whose value contains the host name the container must bind on.static StringLOCAL_PORTThis constant is the name of the TCP port the container node must listen to for incoming IMTP messages.static StringLOCAL_PORT_RANGEThis constant is the name of the property specifying the range to select the TCP port the container node must listen to for incoming IMTP messages.static StringLOCAL_SERVICE_MANAGERThis constant is the name of the property whose Boolean value tells whether a local Service Manager is exported by this container (only when using JADE support for fault-tolerant platform configurations).static StringLOCALHOST_CONSTANTstatic StringLOOPBACK_ADDRESS_CONSTANTstatic StringMAINThis constant is the name of the property whose value contains a boolean indicating if this is the Main Container or a peripheral container.static StringMAIN_HOSTThis constant is the name of the property whose value is the name (or the IP address) of the network host where the JADE Main Container is running.static StringMAIN_PORTThis constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for container registrations.static StringMAIN_PROTOThis constant is the name of the property whose value is a String indicating the protocol to use to connect to the Main Container.static StringMIDPstatic StringMTPSThis constant is the key of the property whose value contains the list of MTPs that have to be launched at bootstrap time.static StringNO_DISPLAYThis constant, when set totruetells the JADE runtime that it will be executed in an environment with no display available.static StringNO_MTPstatic StringOWNERstatic StringPJAVAstatic StringPLATFORM_IDThis constant is the name of the property whose value contains the unique platform ID of a JADE platform.static StringPRIVILEDGE_LOGICAL_NAMEThis constant is the name of the property whose value (true or false) instructs JADE to try to use host names instead of IP addresses in intra-platform communication.static StringREMOTE_SERVICE_MANAGER_ADDRESSESThis constant is the name of the property whose value contains the list of addresses through which the platform Service Manager can be reached.static StringRMI_IMTPstatic StringSERVICESThis constants is the name of the property whose value contains the list of kernel-level services that have to be launched at bootstrap timestatic StringSTYLE_3_Xstatic StringUSERAUTH_KEYThis constant is the name of the property whose value contains the user authentication type to be used to login to the JADE platform.
-
Constructor Summary
Constructors Constructor Description Profile()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static booleancompareHostNames(String host1, String host2)Compares two host names/addresses regardless of whether they include domain or not.static booleancompareTransportAddresses(TransportAddress ta1, TransportAddress ta2)static booleancompareTransportAddresses(String addr1, String addr2, IMTPManager imtpManager)Compares two stringified transport addresses.abstract booleangetBooleanProperty(String key, boolean aDefault)Retrieve a boolean value for a configuration property.abstract PropertiesgetBootProperties()Retrieve the configuration properties as they were passed to this Profile object, i.e.protected abstract jade.core.CommandProcessorgetCommandProcessor()Obtain a reference to the container Command Processor, which manages kernel-level commands dispatching them to the proper platform services.static StringgetDefaultNetworkName()static StringgetDefaultNetworkName(boolean priviledgeLogicalName)protected abstract IMTPManagergetIMTPManager()protected abstract MainContainerImplgetMain()abstract StringgetParameter(String key, String aDefault)Retrieve a String value from the configuration properties.abstract ResourceManagergetResourceManager()protected abstract ServiceFindergetServiceFinder()Obtain a reference to the platform Service Finder, with which kernel-level services can be looked up.protected abstract ServiceManagergetServiceManager()Obtain a reference to the platform Service Manager, with which kernel-level services can be added and removed.abstract ListgetSpecifiers(String key)Retrieve a list of Specifiers from the configuration properties.booleanisBackupMain()Provides a boolean indication about whether or not the container using this Profile is a Backup Main Container.static booleanisLocalHost(String host)Check whether or not a given host name or address corresponds to a local network interfacebooleanisMain()Provides a boolean indication about whether or not the container using this Profile is a Main Container.booleanisMasterMain()Provides a boolean indication about whether or not the container using this Profile is the Master Main Container.abstract voidsetParameter(String key, String value)Assign the given value to the given property name.abstract voidsetSpecifiers(String key, List value)Assign the given value to the given property name.
-
-
-
Field Detail
-
MAIN
public static final String MAIN
This constant is the name of the property whose value contains a boolean indicating if this is the Main Container or a peripheral container.- See Also:
- Constant Field Values
-
MAIN_PROTO
public static final String MAIN_PROTO
This constant is the name of the property whose value is a String indicating the protocol to use to connect to the Main Container.- See Also:
- Constant Field Values
-
MAIN_HOST
public static final String MAIN_HOST
This constant is the name of the property whose value is the name (or the IP address) of the network host where the JADE Main Container is running.- See Also:
- Constant Field Values
-
MAIN_PORT
public static final String MAIN_PORT
This constant is the name of the property whose value contains an integer representing the port number where the Main Container is listening for container registrations.- See Also:
- Constant Field Values
-
DETECT_MAIN
public static final String DETECT_MAIN
This constant is the name of the property whose Boolean value tells whether to activate the automatic main container detection mechanism. By means of this mechanism a peripheral container is able to automatically detect the main container host and port at startup time. The mechanism is based on IP multicast communication and must be activated on both the main container, that publishes its host and port on a given multicast address (by default 239.255.10.99, port 1199), and on peripheral containers. The default for this option istrueon Main Containers andfalseon peripheral containers- See Also:
- Constant Field Values
-
PRIVILEDGE_LOGICAL_NAME
public static final String PRIVILEDGE_LOGICAL_NAME
This constant is the name of the property whose value (true or false) instructs JADE to try to use host names instead of IP addresses in intra-platform communication. Default is false (IP addresses are used preferentially)- See Also:
- Constant Field Values
-
LOCAL_HOST
public static final String LOCAL_HOST
This constant is the name of the property whose value contains the host name the container must bind on. The host name must refer to the local machine, and is generally needed only when multiple network interfaces are present or a non-default name is desired.- See Also:
- Constant Field Values
-
LOCAL_PORT
public static final String LOCAL_PORT
This constant is the name of the TCP port the container node must listen to for incoming IMTP messages.- See Also:
- Constant Field Values
-
LOCAL_PORT_RANGE
public static final String LOCAL_PORT_RANGE
This constant is the name of the property specifying the range to select the TCP port the container node must listen to for incoming IMTP messages. The value for that property must be expressed in the form- , e.g. 50000-50010 indicating that a free port will be selected between port 50000 (included) and 50010 (excluded). If specified, this property overrides the local-port property. - See Also:
- Constant Field Values
-
EXPORT_HOST
public static final String EXPORT_HOST
This constant is the name or address of the host that other containers will have to use to contact this container- See Also:
- Constant Field Values
-
EXPORT_PORT
public static final String EXPORT_PORT
This constant is the port that other containers will have to use to contact this container- See Also:
- Constant Field Values
-
GUI
public static final String GUI
- See Also:
- Constant Field Values
-
LOCAL_SERVICE_MANAGER
public static final String LOCAL_SERVICE_MANAGER
This constant is the name of the property whose Boolean value tells whether a local Service Manager is exported by this container (only when using JADE support for fault-tolerant platform configurations).- See Also:
- Constant Field Values
-
DUMP_OPTIONS
public static final String DUMP_OPTIONS
This constant is the name of the property whose Boolean value tells whether startup options should be dumped. Default is false- See Also:
- Constant Field Values
-
NO_DISPLAY
public static final String NO_DISPLAY
This constant, when set totruetells the JADE runtime that it will be executed in an environment with no display available.- See Also:
- Constant Field Values
-
OWNER
public static final String OWNER
- See Also:
- Constant Field Values
-
DEFAULT_SERVICES
public static final String DEFAULT_SERVICES
- See Also:
- Constant Field Values
-
DEFAULT_SERVICES_NOMOBILITY
public static final String DEFAULT_SERVICES_NOMOBILITY
- See Also:
- Constant Field Values
-
PLATFORM_ID
public static final String PLATFORM_ID
This constant is the name of the property whose value contains the unique platform ID of a JADE platform. Agent GUIDs in JADE are made by a platform-unique nickname, the '@' character and the platform ID.- See Also:
- Constant Field Values
-
USERAUTH_KEY
public static final String USERAUTH_KEY
This constant is the name of the property whose value contains the user authentication type to be used to login to the JADE platform.- See Also:
- Constant Field Values
-
AGENTS
public static final String AGENTS
This constant is the name of the property whose value contains the list of agents that have to be launched at bootstrap time- See Also:
- Constant Field Values
-
SERVICES
public static final String SERVICES
This constants is the name of the property whose value contains the list of kernel-level services that have to be launched at bootstrap time- See Also:
- Constant Field Values
-
REMOTE_SERVICE_MANAGER_ADDRESSES
public static final String REMOTE_SERVICE_MANAGER_ADDRESSES
This constant is the name of the property whose value contains the list of addresses through which the platform Service Manager can be reached.- See Also:
- Constant Field Values
-
MTPS
public static final String MTPS
This constant is the key of the property whose value contains the list of MTPs that have to be launched at bootstrap time. This list must be retrieved via thegetSpecifiers(MTPS)method.- See Also:
- Constant Field Values
-
NO_MTP
public static final String NO_MTP
- See Also:
- Constant Field Values
-
IMTP
public static final String IMTP
This constant is the key of the property whose value identifies the IMTP Manager to be created by ProfileImpl- See Also:
- Constant Field Values
-
CONTAINER_NAME
public static final String CONTAINER_NAME
This constant is the key of the property whose value contains the desired name of the container. If this container name exists already, then a default name is assigned by the platform. The name of the main-container is always assigned by the platform and cannot be changed.- See Also:
- Constant Field Values
-
AGENT_TAG
public static final String AGENT_TAG
This constant is the key of the property whose value will substitute the %A wildcard in names of all agents that will start in the local container.- See Also:
- Constant Field Values
-
ACLCODECS
public static final String ACLCODECS
This constant is the key of the property whose value contains the list of ACLCODECSs that have to be launched at bootstrap time. This list must be retrieved via thegetSpecifiers(ACLCODECS)method.- See Also:
- Constant Field Values
-
ACCEPT_FOREIGN_AGENTS
public static final String ACCEPT_FOREIGN_AGENTS
This constant is the key of the property whose value (true or false) indicates whether or not this platform accepts foreign agents i.e. agents whose names are not of the form@ . - See Also:
- Constant Field Values
-
STYLE_3_X
public static final String STYLE_3_X
- See Also:
- Constant Field Values
-
FILE_DIR
public static final String FILE_DIR
This constant is the key of the property whose value contains the name of the directory where all the files generated by JADE should be put. The default value is the current directory.- See Also:
- Constant Field Values
-
IP_VERSION
public static final String IP_VERSION
This constant is the key of the property whose value contains the version of IP address to use.- See Also:
- Constant Field Values
-
IPV4
public static final int IPV4
- See Also:
- Constant Field Values
-
IPV6
public static final int IPV6
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
LOCALHOST_CONSTANT
public static final String LOCALHOST_CONSTANT
- See Also:
- Constant Field Values
-
LOOPBACK_ADDRESS_CONSTANT
public static final String LOOPBACK_ADDRESS_CONSTANT
- See Also:
- Constant Field Values
-
LEAP_IMTP
public static final String LEAP_IMTP
- See Also:
- Constant Field Values
-
RMI_IMTP
public static final String RMI_IMTP
- See Also:
- Constant Field Values
-
JVM
public static final String JVM
This constant is the key of the property whose value contains the indication about the type of JVM.- See Also:
- Constant Field Values
-
J2SE
public static final String J2SE
- See Also:
- Constant Field Values
-
PJAVA
public static final String PJAVA
- See Also:
- Constant Field Values
-
MIDP
public static final String MIDP
- See Also:
- Constant Field Values
-
ANDROID
public static final String ANDROID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getServiceManager
protected abstract ServiceManager getServiceManager() throws ProfileException
Obtain a reference to the platform Service Manager, with which kernel-level services can be added and removed.- Returns:
- A
ServiceManagerobject, representing the platform service manager. - Throws:
ProfileException
-
getServiceFinder
protected abstract ServiceFinder getServiceFinder() throws ProfileException
Obtain a reference to the platform Service Finder, with which kernel-level services can be looked up.- Returns:
- A
ServiceFinderobject, representing the platform service manager. - Throws:
ProfileException
-
getCommandProcessor
protected abstract jade.core.CommandProcessor getCommandProcessor() throws ProfileExceptionObtain a reference to the container Command Processor, which manages kernel-level commands dispatching them to the proper platform services.- Returns:
- A
ServiceManagerobject, representing the platform service manager. - Throws:
ProfileException
-
getMain
protected abstract MainContainerImpl getMain() throws ProfileException
- Throws:
ProfileException
-
getIMTPManager
protected abstract IMTPManager getIMTPManager() throws ProfileException
- Throws:
ProfileException
-
getResourceManager
public abstract ResourceManager getResourceManager() throws ProfileException
- Throws:
ProfileException
-
getBootProperties
public abstract Properties getBootProperties()
Retrieve the configuration properties as they were passed to this Profile object, i.e. without internal initializations automatically performed by the Profile class.
-
getParameter
public abstract String getParameter(String key, String aDefault)
Retrieve a String value from the configuration properties. If no parameter corresponding to the specified key is found, return the provided default.- Parameters:
key- The key identifying the parameter to be retrieved among the configuration properties.aDefault- The value to return when there is no property set for the given key.
-
getBooleanProperty
public abstract boolean getBooleanProperty(String key, boolean aDefault)
Retrieve a boolean value for a configuration property. If no corresponding property is found or if its string value cannot be converted to a boolean one, a default value is returned.- Parameters:
key- The key identifying the parameter to be retrieved among the configuration properties.aDefault- The value to return when there is no property set for the given key, or its value cannot be converted to a boolean value.
-
getSpecifiers
public abstract List getSpecifiers(String key) throws ProfileException
Retrieve a list of Specifiers from the configuration properties. Agents, MTPs and other items are specified among the configuration properties in this way. If no list of Specifiers corresponding to the specified key is found, an empty list is returned.- Parameters:
key- The key identifying the list of Specifires to be retrieved among the configuration properties.- Throws:
ProfileException
-
setParameter
public abstract void setParameter(String key, String value)
Assign the given value to the given property name.- Parameters:
key- is the property namevalue- is the property value
-
setSpecifiers
public abstract void setSpecifiers(String key, List value)
Assign the given value to the given property name.- Parameters:
key- is the property namevalue- is the property value
-
isMain
public boolean isMain()
Provides a boolean indication about whether or not the container using this Profile is a Main Container.- Returns:
trueif the container using this Profile is a Main Container.falseotherwise
-
isMasterMain
public boolean isMasterMain()
Provides a boolean indication about whether or not the container using this Profile is the Master Main Container.- Returns:
trueif the container using this Profile is the Master Main Container.falseotherwise
-
isBackupMain
public boolean isBackupMain()
Provides a boolean indication about whether or not the container using this Profile is a Backup Main Container.- Returns:
trueif the container using this Profile is a Backup Main Container.falseotherwise
-
getDefaultNetworkName
public static String getDefaultNetworkName()
-
getDefaultNetworkName
public static String getDefaultNetworkName(boolean priviledgeLogicalName)
-
isLocalHost
public static boolean isLocalHost(String host)
Check whether or not a given host name or address corresponds to a local network interface
-
compareHostNames
public static boolean compareHostNames(String host1, String host2)
Compares two host names/addresses regardless of whether they include domain or not.
-
compareTransportAddresses
public static boolean compareTransportAddresses(String addr1, String addr2, IMTPManager imtpManager)
Compares two stringified transport addresses. The provided IMTPManager must be able to deal with the protocols (e.g. http) the two transport address refer to.
-
compareTransportAddresses
public static boolean compareTransportAddresses(TransportAddress ta1, TransportAddress ta2)
-
-