|
Knopflerfish OSGi 2.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.osgi.util.xml.XMLTransformerActivator
public class XMLTransformerActivator
A BundleActivator class that allows any JAXP compliant XML Transformer to register itself as an OSGi parser service. Multiple JAXP compliant transformers can concurrently register by using this BundleActivator class. Bundles who wish to use an XML transformer can then use the framework's service registry to locate available XML transformers with the desired characteristics.
The services that this bundle activator enables a bundle to provide are:
javax.xml.transform.TransformerFactory
javax.xml.xpath.XPathFactory
The algorithm to find the implementations of the abstract transformer is derived from the JAR file specifications, specifically the Services API.
A TransformerFactory creator assumes that it can find the class file names of available factory classes in the file:
/META-INF/services/javax.xml.transform.TransformerFactory
inside the JAR file that provides the class.
An XPathFactory creator assumes that it can find the class file names of available factory classes in the file:
/META-INF/services/javax.xml.xpath.XPathFactory
inside the JAR file that provides the class.
XMLTransformerActivator
attempts to instantiate both the
TransformerFactory
and the XPathFactory
.
It registers each factory with the framework.
Field Summary | |
---|---|
static java.lang.String |
TRANSFORMERCLASSFILE
Fully qualified path name of TransofrmerFactory Class Name file |
static java.lang.String |
TRANSFORMERFACOTRYDESCR
|
static java.lang.String |
TRANSFORMERFACTORYNAME
Filename containing the TransformerFactory class name. |
static java.lang.String |
XPATHCLASSFILE
Fully qualified path name of the XPath Factory Class Name file |
static java.lang.String |
XPATHFACOTRYDESCR
|
static java.lang.String |
XPATHFACTORYNAME
Filename containing the XPathFactory class name. |
Constructor Summary | |
---|---|
XMLTransformerActivator()
|
Method Summary | |
---|---|
java.lang.Object |
getService(Bundle bundle,
ServiceRegistration registration)
Creates a new Transformer / XPath Factory object. |
void |
start(BundleContext context)
Called when this bundle is started so the Framework can perform the bundle-specific activities necessary to start this bundle. |
void |
stop(BundleContext context)
This method has nothing to do as all active service registrations will automatically get unregistered when the bundle stops. |
void |
ungetService(Bundle bundle,
ServiceRegistration registration,
java.lang.Object service)
Releases a Factory object. |
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 TRANSFORMERFACTORYNAME
SERVICE_PID registration property.
- See Also:
- Constant Field Values
public static final java.lang.String TRANSFORMERFACOTRYDESCR
public static final java.lang.String XPATHFACTORYNAME
SERVICE_PID
registration property.
public static final java.lang.String XPATHFACOTRYDESCR
public static final java.lang.String TRANSFORMERCLASSFILE
public static final java.lang.String XPATHCLASSFILE
Constructor Detail |
---|
public XMLTransformerActivator()
Method Detail |
---|
public void start(BundleContext context) throws java.lang.Exception
This method must complete and return to its caller in a timely manner.
This method attempts to register a SAX and DOM parser with the Framework's service registry.
start
in interface BundleActivator
context
- The execution context of the bundle being started.
java.lang.Exception
- If this method throws an exception, this
bundle is marked as stopped and the Framework will remove this
bundle's listeners, unregister all services registered by this
bundle, and release all services used by this bundle.Bundle.start()
public void stop(BundleContext context) throws java.lang.Exception
This method has nothing to do as all active service registrations will automatically get unregistered when the bundle stops.
stop
in interface BundleActivator
context
- The execution context of the bundle being stopped.
java.lang.Exception
- If this method throws an exception, the
bundle is still marked as stopped, and the Framework will remove
the bundle's listeners, unregister all services registered by the
bundle, and release all services used by the bundle.Bundle.stop()
public java.lang.Object getService(Bundle bundle, ServiceRegistration registration)
A unique Factory object is returned for each call to this method.
getService
in interface ServiceFactory
bundle
- The bundle using the service.registration
- The ServiceRegistration
object for the
service.
BundleContext.getService(org.osgi.framework.ServiceReference)
public void ungetService(Bundle bundle, ServiceRegistration registration, java.lang.Object service)
ungetService
in interface ServiceFactory
bundle
- The bundle releasing the service.registration
- The ServiceRegistration
object for the
service.service
- The Factory object returned by a previous call
to the getService
method.BundleContext.ungetService(org.osgi.framework.ServiceReference)
|
Knopflerfish OSGi 2.4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |