|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ws4d.java.DPWSFramework
public final class DPWSFramework
This is the main framework class for the Java Multiedition DPWS Stack (JMEDS 2.0).
It offers static methods to start and stop the framework.
This class verifies the existence of the following modules:
Furthermore this class allows access to some special and optional framework components like:
ThreadPool
CommunicationManager
(at least one is necessary)MonitorStreamFactory
(optional)FileSystem
(optional)
Important: It is necessary to start
the framework before anything else can be used!
Your code could look something like this:
DPWSFramework.start(args); // Your code here DPWSFramework.stop();
Field Summary | |
---|---|
static int |
ATTACHMENT_MODULE
Identifier for the attachment support. |
static int |
CLIENT_MODULE
Identifier for the client support (Client module). |
static int |
COMMUNICATION_DPWS_MODULE
|
static int |
EVENTING_MODULE
Identifier for the event support. |
static int |
PLATFORM_CLDC_MODULE
Identifier for the CLDC platform support. |
static int |
PLATFORM_SE_MODULE
Identifier for the SE platform support. |
static int |
PRESENTATION_MODULE
|
static int |
SECURITY_MODULE
Identifier for the security support. |
static int |
SERVICE_MODULE
Identifier for the service and device support. |
Method Summary | |
---|---|
static void |
addClientSubscrption(ClientSubscription subscription)
Adds a event subscription to the framework. |
static AttachmentFactory |
getAttachmentFactory()
Returns an implementation of the attachment factory which allows to handle incoming and outgoing attachments. |
static CommunicationManager |
getCommunicationManager(java.lang.String comManId)
Returns an instance of a communication manager based on the given identifier. |
static EventingFactory |
getEventingFactory()
|
static FileSystem |
getLocalFileSystem()
Returns an implementation of the file system supported by the given platform. |
static MonitorStreamFactory |
getMonitorStreamFactory()
Returns the MonitorStreamFactory which allows to wrap
streams and redistribute data. |
static Presentation |
getPresentation()
Returns the class which allows to create a presentation URL. |
static ProxyFactory |
getProxyFactory()
|
static ResourceLoader |
getResourceAsStream(URI location)
Returns an input stream which allows to read a resource from the given location. |
static SecurityManager |
getSecurityManager()
|
static ThreadPool |
getThreadPool()
Returns the thread pool used by the framework. |
static Toolkit |
getToolkit()
Get the Toolkit of this framework. |
static boolean |
hasModule(int module)
Allows to verify whether a module has been loaded and can be used or not. |
static boolean |
isRunning()
Indicates whether the framework was started or not. |
static void |
kill()
Stops the framework immediately!!!! |
static boolean |
onCldcLibrary()
checks whether the current framework instance is running on top of the CLDC library. |
static void |
removeClientSubscrption(ClientSubscription subscription)
Removes a event subscription. |
static void |
setMonitorStreamFactory(MonitorStreamFactory factory)
Set the factory for stream monitoring. |
static void |
setPropertiesPath(java.lang.String path)
|
static void |
start(java.lang.String[] args)
Starts the framework. |
static void |
stop()
Stops the framework as soon as possible. |
static boolean |
supportsConfiguration(int config)
Allows to verify whether some modules are loaded or not. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CLIENT_MODULE
This identifier can be used to verify whether the Client module
has been loaded or not. To check this module, use the
hasModule(int)
method.
The Client module includes the classes to create a DPWS client and the classes which are necessary if the client wants to use the device and service discovery.
public static final int SERVICE_MODULE
This identifier can be used to verify whether the Service module
has been loaded or not. To check this module, use the
hasModule(int)
method.
The Service module includes the classes to create a DPWS device and service.
public static final int EVENTING_MODULE
This identifier can be used to verify whether the Eventing module
has been loaded or not. To check this module, use the
hasModule(int)
method.
The Eventing module includes the classes to handle incoming DPWS events.
public static final int PLATFORM_SE_MODULE
This identifier can be used to verify whether the SE module has
been loaded or not. To check this module, use the hasModule(int)
method.
The SE module includes the classes which allow networking and file access for Java SE platforms.
public static final int PLATFORM_CLDC_MODULE
This identifier can be used to verify whether the CLDC module has
been loaded or not. To check this module, use the hasModule(int)
method.
The CLDC module includes the classes which allow networking for Java CLDC platforms.
public static final int ATTACHMENT_MODULE
This identifier can be used to verify whether the Attachment
module has been loaded or not. To check this module, use the
hasModule(int)
method.
The Attachment module includes the classes to send and receive attachments.
public static final int SECURITY_MODULE
This identifier can be used to verify whether the Security module
has been loaded or not. To check this module, use the
hasModule(int)
method.
The Security module includes the classes to secure the DPWS communication, using WS-Security techniques.
public static final int PRESENTATION_MODULE
public static final int COMMUNICATION_DPWS_MODULE
Method Detail |
---|
public static void start(java.lang.String[] args)
This method initializes the necessary framework components.
Important: It is necessary to start
the framework before anything else can be used!
This method starts the watchdog, loads the properties and initializes the communications modules.
args
- Here you can pass-through the command-line arguments. the
first element is interpreted as the location of the properties
file.public static void stop()
This method is the counter piece to start(String[])
. It stops
the framework and the running components. This method will wait until the
opened connection are ready to be closed.
If it is necessary to stop the framework immediately the kill()
method should be used.
start(String[])
,
kill()
public static void kill()
This method is the counter piece to start(String[])
. It stops
the framework and the running components. This method will
not wait until the opened connection are ready to be
closed, any existing connection will be closed instant.
start(String[])
,
stop()
public static boolean isRunning()
This method returns true
if the framework is running,
false
otherwise.
true
if the framework is running, false
otherwise.public static void addClientSubscrption(ClientSubscription subscription)
subscription
- the subscription which the framework should take care
about.public static void removeClientSubscrption(ClientSubscription subscription)
subscription
- the subscription which is not important any more.public static boolean hasModule(int module)
You can check the modules listed below.
module
- the module identifier.
true
if the module has been loaded,
false
otherwise.CLIENT_MODULE
,
SERVICE_MODULE
,
EVENTING_MODULE
,
ATTACHMENT_MODULE
,
PLATFORM_SE_MODULE
,
PLATFORM_CLDC_MODULE
,
SECURITY_MODULE
,
ATTACHMENT_MODULE
,
PRESENTATION_MODULE
public static boolean supportsConfiguration(int config)
This method allows to check several modules with one method. If you want
to check only one module, see the hasModule(int)
method.
You can check the modules listed below.
config
- the modules to check.
To check more than one module, sum up their values.
e.g. DPWS_CLIENT_MODULE+DPWS_SERVICE_MODULE
true
if all given modules have been loaded,
false
otherwise.CLIENT_MODULE
,
SERVICE_MODULE
,
EVENTING_MODULE
,
ATTACHMENT_MODULE
,
PLATFORM_SE_MODULE
,
PLATFORM_CLDC_MODULE
public static ThreadPool getThreadPool()
This thread pool is necessary for thread handling, because CLDC does not have an own thread pool. All threads created by the framework are created with this thread pool.
public static CommunicationManager getCommunicationManager(java.lang.String comManId)
The communication manager is a special layer for communication. It allows the handling of incoming messages for different technologies. e.g. DPWS.
comManId
- the identifier to receive a
CommunicationManager
.
CommunicationManager
public static ResourceLoader getResourceAsStream(URI location) throws java.io.IOException
The location is a URL. The loaded communication managers can be registered for different URL schemas. This allows the loading of resources from different locations.
location
- the location of the resource (e.g.
http://example.org/test.wsdl).
ResourceLoader
containing input stream for the given
resource and ProtocolData
for network resources. Returns
null
if no communication manager could find a
resource at the given location.
java.io.IOException
- throws an exception when the resource could not be
loaded properly.public static Toolkit getToolkit()
The retrieved toolkit includes Java Edition specific utility methods. Framework must have already been started.
public static Presentation getPresentation()
public static void setMonitorStreamFactory(MonitorStreamFactory factory)
This enables the monitoring of streams for debug purposes. A
MonitorStreamFactory
wraps streams to redistribute data. A
communication manager can use the factory to redistribute data to the
streams created by the factory.
factory
- the factory which wraps streams and redistribute data.public static MonitorStreamFactory getMonitorStreamFactory()
MonitorStreamFactory
which allows to wrap
streams and redistribute data.
setMonitorStreamFactory(MonitorStreamFactory)
public static FileSystem getLocalFileSystem() throws java.io.IOException
It is necessary to load the corresponding module for platform support.
java.io.IOException
- will throw an exception when the module could not be
loaded correctly or the runtime configuration does not
support a local file system.PLATFORM_SE_MODULE
,
PLATFORM_CLDC_MODULE
public static SecurityManager getSecurityManager()
public static void setPropertiesPath(java.lang.String path)
public static AttachmentFactory getAttachmentFactory() throws java.io.IOException
It is necessary to load the corresponding module for attachment support.
java.io.IOException
public static EventingFactory getEventingFactory() throws java.io.IOException
java.io.IOException
public static ProxyFactory getProxyFactory() throws java.io.IOException
java.io.IOException
public static boolean onCldcLibrary()
true
if this is the case.
in case the framework runs on top of the Java
CLDC configuration
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |