ilog.cpl.service
Class IlpDefaultContext

java.lang.Object
  extended by ilog.cpl.service.IlpDefaultContext
All Implemented Interfaces:
IlpContext
Direct Known Subclasses:
IltDefaultContext, IltFacesDefaultContext

public class IlpDefaultContext
extends Object
implements IlpContext

Provides access to the services and contextual information.

Since:
JTGO 3.0

Constructor Summary
IlpDefaultContext()
          Default constructor.
IlpDefaultContext(IlpContext context)
          Copy constructor.
IlpDefaultContext(Locale locale)
          Constructor with locale parameter.
 
Method Summary
 void addService(Class serviceClass, Object service)
          Adds a service to the available services of the context.
protected  IlpBlinkingManager createBlinkingManager()
          Creates a IlpBlinkingManager to be used by this context.
protected  IlpClassLoaderService createClassLoaderService()
          Creates a IlpClassLoaderService to be used by this context.
protected  IlpClassManager createClassManager()
          Creates a IlpClassManager to be used by this context.
protected  IlpDataSourceManager createDataSourceManager()
          Creates a IlpDataSourceManager to be used by this context.
protected  IlpImageRepository createImageRepository()
          Creates a IlpImageRepository to be used by this context.
protected  IlpInteractorManager createInteractorManager()
          Creates a IlpInteractorManager to be used by this context.
protected  IlpMonitoringService createMonitoringService()
          Creates a IlpMonitoringService to be used by this context.
protected  IlSynchronizationStrategy createSynchronizationStrategy()
          Creates a IlSynchronizationStrategy to be used by this context.
protected  IlpTypeConverter createTypeConverter()
          Creates a IlpTypeConverter to be used by this context.
protected  IlpURLAccessService createURLAccessService()
          Creates a IlpURLAccessService to be used by this context.
 IlpBlinkingManager getBlinkingManager()
          Returns the blinking manager.
 IlpClassLoaderService getClassLoaderService()
          Returns the class loader service.
 IlpMutableClassManager getClassManager()
          Returns the class manager.
 IlpMutableDataSourceManager getDataSourceManager()
          Returns the data source manager.
 String getDocumentBase()
          Get the DocumentBase value.
 IlpImageRepository getImageRepository()
          Returns the image repository.
 IlpMutableInteractorManager getInteractorManager()
          Returns the interactor manager.
 Locale getLocale()
          Returns the locale.
 IlpMonitoringService getMonitoringService()
          Returns the monitoring service.
 Map getProperties()
          Returns all the properties of this context as a Map containing property names in the form of keys mapped to values.
 Object getProperty(String name)
          Returns a property value of the context.
 Object getService(Class serviceClass)
          Retrieves a service by its Java class.
 Collection getServices()
          Retrieves the list of available service classes as a collection.
 IlpStyleManager getStyleManager()
          Deprecated. The Style API has been replaced by the Cascading Style Sheet mechanism. Please refer to the User's Manual for further information.
 IlSynchronizationStrategy getSynchronizationStrategy()
          Returns the synchronization strategy.
 IlpTypeConverter getTypeConverter()
          Returns the type converter.
 IlpURLAccessService getURLAccessService()
          Returns the URL access service.
 void removeService(Class serviceClass, Object service)
          Removes a service from the available services of the context.
 void setDeploymentFile(String newDeploymentFile)
          Sets the DeploymentFile value and applies it to this context, using the document base.
 void setDocumentBase(String newDocumentBase)
          Set the DocumentBase value, and apply the deployment descriptor to this context object if the deployment file is set.
 void setLocale(Locale locale)
          Sets the locale.
 void setProperty(String name, Object property)
          Sets a property value in the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpDefaultContext

public IlpDefaultContext()
Default constructor.

The locale that is obtained is the default locale (see Locale.getDefault()).

See Also:
for retrieving the default context, for the default services that are created.

IlpDefaultContext

public IlpDefaultContext(Locale locale)
Constructor with locale parameter. Some services are initialized by default:

Parameters:
locale - The locale to be used in this context. If the locale is null, the default locale is used (see Locale.getDefault()).

IlpDefaultContext

public IlpDefaultContext(IlpContext context)
Copy constructor. Copies the locale, the list of services and the properties of the context passed as parameter.

Method Detail

getLocale

public Locale getLocale()
Returns the locale.

Specified by:
getLocale in interface IlpContext
Returns:
The locale used within this context.

setLocale

public void setLocale(Locale locale)
Sets the locale.

Parameters:
locale - The locale used within this context.

getProperty

public Object getProperty(String name)
Returns a property value of the context.

Specified by:
getProperty in interface IlpContext
Parameters:
name - The name of the property.
Returns:
The property value corresponding to the name. It may be null.

setProperty

public void setProperty(String name,
                        Object property)
Sets a property value in the context.

Parameters:
name - The name of the property.
property - The property being stored
Since:
JTGO 4.0

getProperties

public Map getProperties()
Returns all the properties of this context as a Map containing property names in the form of keys mapped to values.

Specified by:
getProperties in interface IlpContext
Returns:
All the properties of the context in a Map.

getURLAccessService

public IlpURLAccessService getURLAccessService()
Returns the URL access service. Note: Calling this method is equivalent to the following code:
(IlpURLAccessService)getService(IlpURLAccessService.class)

Specified by:
getURLAccessService in interface IlpContext
Returns:
The URL access service.

getService

public Object getService(Class serviceClass)
Retrieves a service by its Java class.

Specified by:
getService in interface IlpContext
Parameters:
serviceClass - The Java class to be implemented by the returned service.
Returns:
A service that implements the given interface.

getServices

public Collection getServices()
Retrieves the list of available service classes as a collection.

Specified by:
getServices in interface IlpContext

addService

public void addService(Class serviceClass,
                       Object service)
Adds a service to the available services of the context.

Parameters:
serviceClass - A class (usually an interface) that identifies and defines the service; for example, IlpURLAccessService.
service - The service implementation; for example, IlpDefaultURLAccessService.

removeService

public void removeService(Class serviceClass,
                          Object service)
Removes a service from the available services of the context.

Parameters:
serviceClass - A class (usually an interface) that identifies and defines the service; for example, IlpURLAccessService.
service - The service implementation; for example, IlpDefaultURLAccessService.

getClassManager

public IlpMutableClassManager getClassManager()
Returns the class manager.

Specified by:
getClassManager in interface IlpContext
Returns:
The class manager.

getDataSourceManager

public IlpMutableDataSourceManager getDataSourceManager()
Returns the data source manager.

Specified by:
getDataSourceManager in interface IlpContext
Returns:
The data source manager.

getStyleManager

public IlpStyleManager getStyleManager()
Deprecated. The Style API has been replaced by the Cascading Style Sheet mechanism. Please refer to the User's Manual for further information.

Returns the style manager.

Specified by:
getStyleManager in interface IlpContext
Returns:
The style manager.
Deprecated Since:
JTGO 3.5

getInteractorManager

public IlpMutableInteractorManager getInteractorManager()
Returns the interactor manager.

Specified by:
getInteractorManager in interface IlpContext
Returns:
The interactor manager.

getBlinkingManager

public IlpBlinkingManager getBlinkingManager()
Returns the blinking manager.

Specified by:
getBlinkingManager in interface IlpContext
Returns:
The blinking manager.

getSynchronizationStrategy

public IlSynchronizationStrategy getSynchronizationStrategy()
Returns the synchronization strategy.

Specified by:
getSynchronizationStrategy in interface IlpContext
Returns:
The synchronization strategy.

getTypeConverter

public IlpTypeConverter getTypeConverter()
Returns the type converter.

Specified by:
getTypeConverter in interface IlpContext

getImageRepository

public IlpImageRepository getImageRepository()
Returns the image repository.

Specified by:
getImageRepository in interface IlpContext
Returns:
The image repository registered with the context.

getClassLoaderService

public IlpClassLoaderService getClassLoaderService()
Returns the class loader service. Note: Calling this method is equivalent to the following code:
(IlpClassLoaderService)getService(IlpClassLoaderService.class)

Specified by:
getClassLoaderService in interface IlpContext
Returns:
The class loader service.
Since:
JTGO 4.5

getMonitoringService

public IlpMonitoringService getMonitoringService()
Returns the monitoring service.

Note: Calling this method is equivalent to the following code:
(IlpMonitoringService)getService(IlpMonitoringService.class)

Specified by:
getMonitoringService in interface IlpContext
Returns:
The class loader service.
Since:
JViews 7.5

setDeploymentFile

public void setDeploymentFile(String newDeploymentFile)
Sets the DeploymentFile value and applies it to this context, using the document base.

Parameters:
newDeploymentFile - The new DeploymentFile value.

getDocumentBase

public String getDocumentBase()
Get the DocumentBase value.

Returns:
the DocumentBase value.

setDocumentBase

public void setDocumentBase(String newDocumentBase)
Set the DocumentBase value, and apply the deployment descriptor to this context object if the deployment file is set.

Parameters:
newDocumentBase - The new DocumentBase value. This value should be an URL or a complete directory path.

createURLAccessService

protected IlpURLAccessService createURLAccessService()
Creates a IlpURLAccessService to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultURLAccessService
Since:
JViews 7.5

createSynchronizationStrategy

protected IlSynchronizationStrategy createSynchronizationStrategy()
Creates a IlSynchronizationStrategy to be used by this context.

Returns:
IlSynchronizationStrategy.GetDefault()
Since:
JViews 7.5

createBlinkingManager

protected IlpBlinkingManager createBlinkingManager()
Creates a IlpBlinkingManager to be used by this context.

Returns:
null as by default a blinking manager is not specified
Since:
JViews 7.5

createClassLoaderService

protected IlpClassLoaderService createClassLoaderService()
Creates a IlpClassLoaderService to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultClassLoaderService
Since:
JViews 7.5

createClassManager

protected IlpClassManager createClassManager()
Creates a IlpClassManager to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultClassManager
Since:
JViews 7.5

createDataSourceManager

protected IlpDataSourceManager createDataSourceManager()
Creates a IlpDataSourceManager to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultDataSourceManager
Since:
JViews 7.5

createImageRepository

protected IlpImageRepository createImageRepository()
Creates a IlpImageRepository to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultImageRepository
Since:
JViews 7.5

createInteractorManager

protected IlpInteractorManager createInteractorManager()
Creates a IlpInteractorManager to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultInteractorManager
Since:
JViews 7.5

createTypeConverter

protected IlpTypeConverter createTypeConverter()
Creates a IlpTypeConverter to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultTypeConverter
Since:
JViews 7.5

createMonitoringService

protected IlpMonitoringService createMonitoringService()
Creates a IlpMonitoringService to be used by this context.

This method is called only by the constructor.

Returns:
An instance of IlpDefaultMonitoringService
Since:
JViews 7.5


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.