Package jade.core
Class ProfileImpl
- java.lang.Object
-
- jade.core.Profile
-
- jade.core.ProfileImpl
-
- Direct Known Subclasses:
BootProfileImpl
public class ProfileImpl extends Profile
This class allows the JADE core to retrieve configuration-dependent classes and boot parameters.Take care of using different instances of this class when launching different containers/main-containers on the same JVM otherwise they would conflict!
- Version:
- 1.0, 22/11/00
- Author:
- Federico Bergenti, Giovanni Rimassa - Universita' di Parma, Giovanni Caire - TILAB
-
-
Field Summary
Fields Modifier and Type Field Description protected PropertiesbootProps-
Fields inherited from class jade.core.Profile
ACCEPT_FOREIGN_AGENTS, ACLCODECS, AGENT_TAG, AGENTS, ANDROID, CONTAINER_NAME, DEFAULT_PORT, DEFAULT_SERVICES, DEFAULT_SERVICES_NOMOBILITY, DETECT_MAIN, DUMP_OPTIONS, EXPORT_HOST, EXPORT_PORT, FILE_DIR, GUI, IMTP, IP_VERSION, IPV4, IPV6, J2SE, JVM, LEAP_IMTP, LOCAL_HOST, LOCAL_PORT, LOCAL_PORT_RANGE, LOCAL_SERVICE_MANAGER, LOCALHOST_CONSTANT, LOOPBACK_ADDRESS_CONSTANT, MAIN, MAIN_HOST, MAIN_PORT, MAIN_PROTO, MIDP, MTPS, NO_DISPLAY, NO_MTP, OWNER, PJAVA, PLATFORM_ID, PRIVILEDGE_LOGICAL_NAME, REMOTE_SERVICE_MANAGER_ADDRESSES, RMI_IMTP, SERVICES, STYLE_3_X, USERAUTH_KEY
-
-
Constructor Summary
Constructors Constructor Description ProfileImpl()This is equivalent toProfileImpl(true)ProfileImpl(boolean isMain)Creates a Profile implementation with the following default configuration:
if isMain is true, then the profile is configured to launch a main-container on the localhost, RMI internal Message Transport Protocol, port number 1099, HTTP MTP.ProfileImpl(Properties aProp)Creates a Profile implementation using the given properties to configure the platform startup process.ProfileImpl(String fileName)Create a Profile object initialized with the settings specified in a given property fileProfileImpl(String host, int port, String platformID)This constructor creates a default Profile for launching a platform (i.e.ProfileImpl(String host, int port, String platformID, boolean isMain)This constructor creates a default Profile for launching a main (or non-main) container (depending on the value ofisMain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBooleanProperty(String aKey, boolean aDefault)Retrieve a boolean value for a configuration property.PropertiesgetBootProperties()Retrieve the configuration properties as they were passed to this Profile object, i.e.protected jade.core.CommandProcessorgetCommandProcessor()Obtain a reference to the container Command Processor, which manages kernel-level commands dispatching them to the proper platform services.protected IMTPManagergetIMTPManager()protected MainContainerImplgetMain()StringgetParameter(String key, String aDefault)Retrieve a String value from the configuration properties.protected PlatformManagergetPlatformManager()PropertiesgetProperties()Return the underlying properties collection.ResourceManagergetResourceManager()protected ServiceFindergetServiceFinder()Access the platform service finder.protected ServiceManagergetServiceManager()Access the platform service manager.ListgetSpecifiers(String key)Retrieve a list of Specifiers from the configuration properties.voidsetParameter(String key, String value)Assign the given value to the given property name.voidsetSpecifiers(String key, List value)Assign the given property value to the given property nameStringtoString()Creates a string representation of this profile.-
Methods inherited from class jade.core.Profile
compareHostNames, compareTransportAddresses, compareTransportAddresses, getDefaultNetworkName, getDefaultNetworkName, isBackupMain, isLocalHost, isMain, isMasterMain
-
-
-
-
Field Detail
-
bootProps
protected Properties bootProps
-
-
Constructor Detail
-
ProfileImpl
public ProfileImpl(Properties aProp)
Creates a Profile implementation using the given properties to configure the platform startup process.- Parameters:
aProp- The names and values of the configuration properties to use.
-
ProfileImpl
public ProfileImpl(boolean isMain)
Creates a Profile implementation with the following default configuration:
if isMain is true, then the profile is configured to launch a main-container on the localhost, RMI internal Message Transport Protocol, port number 1099, HTTP MTP.
if isMain is false, then the profile is configured to launch a remote container on the localhost, connecting to the main-container on the localhost through RMI internal Message Transport Protocol, port number 1099.
-
ProfileImpl
public ProfileImpl()
This is equivalent toProfileImpl(true)
-
ProfileImpl
public ProfileImpl(String fileName) throws ProfileException
Create a Profile object initialized with the settings specified in a given property file- Throws:
ProfileException
-
ProfileImpl
public ProfileImpl(String host, int port, String platformID)
This constructor creates a default Profile for launching a platform (i.e. a main container!!).- Parameters:
host- is the name of the host where the main-container should be listen to. A null value means use the default (i.e. localhost)port- is the port number where the main-container should be listen for other containers. A negative value should be used for using the default port number.platformID- is the symbolic name of the platform, if different from default. A null value means use the default (i.e. localhost)
-
ProfileImpl
public ProfileImpl(String host, int port, String platformID, boolean isMain)
This constructor creates a default Profile for launching a main (or non-main) container (depending on the value ofisMain)- Parameters:
host- is the name of the host where the main-container should be listen to. A null value means use the default (i.e. localhost)port- is the port number where the main-container should be listen for other containers. A negative value should be used for using the default port number.platformID- is the symbolic name of the platform, if different from default. A null value means use the default (i.e. localhost)isMain- if isMain is false, then the profile is configured to launch a remote container, if true a main-container
-
-
Method Detail
-
getProperties
public Properties getProperties()
Return the underlying properties collection.- Returns:
- Properties The properties collection.
-
getBootProperties
public 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.- Specified by:
getBootPropertiesin classProfile
-
setParameter
public void setParameter(String key, String value)
Assign the given value to the given property name.- Specified by:
setParameterin classProfile- Parameters:
key- is the property namevalue- is the property value
-
setSpecifiers
public void setSpecifiers(String key, List value)
Assign the given property value to the given property name- Specified by:
setSpecifiersin classProfile- Parameters:
key- is the property namevalue- is the property value
-
getParameter
public String getParameter(String key, String aDefault)
Retrieve a String value from the configuration properties. If no parameter corresponding to the specified key is found,aDefaultis returned.- Specified by:
getParameterin classProfile- Parameters:
key- The key identifying the parameter to be retrieved among the configuration properties.aDefault- The value that is returned if the specified key is not found
-
getSpecifiers
public 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.- Specified by:
getSpecifiersin classProfile- Parameters:
key- The key identifying the list of Specifires to be retrieved among the configuration properties.- Throws:
ProfileException
-
getBooleanProperty
public boolean getBooleanProperty(String aKey, 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.- Specified by:
getBooleanPropertyin classProfile- 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.
-
toString
public String toString()
Creates a string representation of this profile. The returned string has the format(profile name1=value1 name2=value2 ... )
-
getPlatformManager
protected PlatformManager getPlatformManager() throws ProfileException
- Throws:
ProfileException
-
getServiceManager
protected ServiceManager getServiceManager() throws ProfileException
Access the platform service manager.- Specified by:
getServiceManagerin classProfile- Returns:
- The platform service manager, either the real implementation or a remote proxy object.
- Throws:
ProfileException- If some needed information is wrong or missing from the profile.
-
getServiceFinder
protected ServiceFinder getServiceFinder() throws ProfileException
Access the platform service finder.- Specified by:
getServiceFinderin classProfile- Returns:
- The platform service finder, either the real implementation or a remote proxy object.
- Throws:
ProfileException- If some needed information is wrong or missing from the profile.
-
getCommandProcessor
protected jade.core.CommandProcessor getCommandProcessor() throws ProfileExceptionDescription copied from class:ProfileObtain a reference to the container Command Processor, which manages kernel-level commands dispatching them to the proper platform services.- Specified by:
getCommandProcessorin classProfile- Returns:
- A
ServiceManagerobject, representing the platform service manager. - Throws:
ProfileException
-
getMain
protected MainContainerImpl getMain() throws ProfileException
- Specified by:
getMainin classProfile- Throws:
ProfileException
-
getIMTPManager
protected IMTPManager getIMTPManager() throws ProfileException
- Specified by:
getIMTPManagerin classProfile- Throws:
ProfileException
-
getResourceManager
public ResourceManager getResourceManager() throws ProfileException
- Specified by:
getResourceManagerin classProfile- Throws:
ProfileException
-
-