|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.commons.Platform
public abstract class Platform
Access to platform specific services.
There is one platform object (singleton) for the JVM. It encapsulate the services for the undelying platform. This platform object is automatically instanciated when necessary.
Field Summary | |
---|---|
static java.lang.String |
FACTORY_CLASS
|
static java.lang.String |
PLATFORM_PROPERTY_KEY
|
static java.lang.String |
PORTAL6_PLATFORM_CLASS
|
Constructor Summary | |
---|---|
protected |
Platform()
|
Method Summary | |
---|---|
protected abstract com.ibm.commons.log.LogMgrFactory |
createLogMgrFactory()
|
abstract java.io.PrintStream |
getErrorStream()
Get the error stream for this platform. |
java.io.InputStream |
getGlobalResource(java.lang.String resourceName)
Get a global resource file as an input stream. |
java.io.File |
getGlobalResourceFile(java.lang.String resourceName)
Get a global resource as a file. |
static Platform |
getInstance()
Return the platform singleton. |
com.ibm.commons.log.LogMgrFactory |
getLogMgrFactory()
Get the Log manager factory used for this platform. |
abstract java.lang.String |
getName()
Return the name of the platform. |
java.lang.Object |
getObject(java.lang.String key)
Get an object cached by the platform. |
abstract java.io.PrintStream |
getOutputStream()
Get the output stream for this platform. |
com.ibm.commons.IPlatformService |
getPlatformService(java.lang.String serviceId)
Return a sevice implementation giving its name. |
java.lang.String |
getProperty(java.lang.String key)
Get a platform property. |
protected void |
initialize()
|
static void |
initPlatform(Platform platform)
|
abstract boolean |
isEclipseBased()
Check if the runtime platform is Eclipse based. |
abstract boolean |
isFeatureEnabled(java.lang.String featureId)
|
boolean |
isPlatform(java.lang.String name)
Check if it is a particular platform. |
void |
log(java.lang.String message)
Log a message. |
void |
log(java.lang.String message,
java.lang.Object... parameters)
Log a message after formatting it. |
void |
log(java.lang.Throwable ex)
Log an exception. |
void |
putProperty(java.lang.String key,
java.lang.String object)
Set a platform property. |
void |
registerPlatformService(java.lang.String serviceId,
com.ibm.commons.IPlatformService platformService)
Register a platform service. |
void |
removeProperty(java.lang.String key)
Remove a platform property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FACTORY_CLASS
public static final java.lang.String PORTAL6_PLATFORM_CLASS
public static final java.lang.String PLATFORM_PROPERTY_KEY
Constructor Detail |
---|
protected Platform()
Method Detail |
---|
public static void initPlatform(Platform platform)
public static Platform getInstance()
protected void initialize()
public abstract java.lang.String getName()
public final com.ibm.commons.log.LogMgrFactory getLogMgrFactory()
protected abstract com.ibm.commons.log.LogMgrFactory createLogMgrFactory()
public abstract java.io.PrintStream getOutputStream()
public abstract java.io.PrintStream getErrorStream()
public abstract boolean isEclipseBased()
public boolean isPlatform(java.lang.String name)
public com.ibm.commons.IPlatformService getPlatformService(java.lang.String serviceId)
serviceId
- : unique id representing the platform service
public void registerPlatformService(java.lang.String serviceId, com.ibm.commons.IPlatformService platformService)
serviceId
- unique idplatformService
- public java.lang.String getProperty(java.lang.String key)
key
- the property name
public void putProperty(java.lang.String key, java.lang.String object)
key
- the property nameobject
- the new property valuepublic void removeProperty(java.lang.String key)
key
- the property namepublic java.io.InputStream getGlobalResource(java.lang.String resourceName)
public java.io.File getGlobalResourceFile(java.lang.String resourceName)
resourceName
-
public java.lang.Object getObject(java.lang.String key)
public void log(java.lang.Throwable ex)
Note that the log not only goes to default output stream, but it can also go a to log file if implemented by the platform.
public void log(java.lang.String message)
Note that the log not only goes to default output stream, but it can also go a to log file if implemented by the platform.
public void log(java.lang.String message, java.lang.Object... parameters)
Note that the log not only goes to default output stream, but it can also go a to log file if implemented by the platform.
public abstract boolean isFeatureEnabled(java.lang.String featureId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |