org.ops4j.pax.url.commons.handler
Class HandlerActivator<T>

java.lang.Object
  extended by org.ops4j.pax.url.commons.handler.HandlerActivator<T>
All Implemented Interfaces:
org.osgi.framework.BundleActivator
Direct Known Subclasses:
Activator, Activator, Activator, Activator, Activator, Activator, Activator, Activator

public class HandlerActivator<T>
extends java.lang.Object
implements org.osgi.framework.BundleActivator

Bundle activator for protocol handlers.

Since:
0.1.0, January 13, 2007
Author:
Alin Dreghiciu

Constructor Summary
HandlerActivator(java.lang.String[] protocols, java.lang.String pid, ConnectionFactory<T> connectionFactory)
          Creates a protocol handler.
 
Method Summary
 void start(org.osgi.framework.BundleContext bundleContext)
          Registers Handler as a wrap: protocol stream handler service and as a configuration managed service if possible.
 void stop(org.osgi.framework.BundleContext bundleContext)
          Performs cleanup:
* Unregister handler;
* Unregister managed service;
* Release bundle context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerActivator

public HandlerActivator(java.lang.String[] protocols,
                        java.lang.String pid,
                        ConnectionFactory<T> connectionFactory)
Creates a protocol handler.

Parameters:
protocols - array of handled protocols. Cannot be null.
pid - service pid. Cannot be null.
connectionFactory - protocol specific connection factory. Cannot be null
Throws:
org.ops4j.lang.NullArgumentException - if any of the paramters is null
Method Detail

start

public void start(org.osgi.framework.BundleContext bundleContext)
Registers Handler as a wrap: protocol stream handler service and as a configuration managed service if possible.

Specified by:
start in interface org.osgi.framework.BundleActivator
Parameters:
bundleContext - the bundle context.
See Also:
BundleActivator.start(org.osgi.framework.BundleContext)

stop

public void stop(org.osgi.framework.BundleContext bundleContext)
Performs cleanup:
* Unregister handler;
* Unregister managed service;
* Release bundle context.

Specified by:
stop in interface org.osgi.framework.BundleActivator
See Also:
BundleActivator.stop(org.osgi.framework.BundleContext)


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.