org.springframework.osgi.service.exporter.support
Class AbstractDependentServiceExporter

java.lang.Object
  extended by org.springframework.osgi.service.exporter.support.AbstractDependentServiceExporter
All Implemented Interfaces:
InitializingBean, DependentServiceExporter
Direct Known Subclasses:
AbstractOsgiServiceExporter

public abstract class AbstractDependentServiceExporter
extends Object
implements DependentServiceExporter, InitializingBean

Base class for ServiceExporters taking care of service registration and unregistration.

Author:
Costin Leau

Constructor Summary
AbstractDependentServiceExporter()
           
 
Method Summary
 void afterPropertiesSet()
           
 boolean isRunning()
          Indicates whether this OSGi component is currently running.
 void setPublishAtStartup(boolean publish)
          Instructs the exporter whether to publish the service at startup or not.
protected  boolean shouldPublishAtStartup()
          Indicates whether the service publication should happen at startup or not.
 void start()
          Starts the OSGi lifecycle.
 void stop()
          Stops the OSGi lifecycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDependentServiceExporter

public AbstractDependentServiceExporter()
Method Detail

shouldPublishAtStartup

protected boolean shouldPublishAtStartup()
Indicates whether the service publication should happen at startup or not.

Returns:
true if the publication should happen at startup, false otherwise.

setPublishAtStartup

public void setPublishAtStartup(boolean publish)
Description copied from interface: DependentServiceExporter
Instructs the exporter whether to publish the service at startup or not. This method is used internally inside the framework to prevent the exporter for publishing a service if it depends on importers with mandatory service import.

Specified by:
setPublishAtStartup in interface DependentServiceExporter
Parameters:
publish - true if the exporter will publish things at startup, false otherwise

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

isRunning

public boolean isRunning()
Description copied from interface: DependentServiceExporter
Indicates whether this OSGi component is currently running.

Specified by:
isRunning in interface DependentServiceExporter
Returns:
true if the component is running, false otherwise

start

public void start()
Description copied from interface: DependentServiceExporter
Starts the OSGi lifecycle. Should not throw an exception if the component is already running.

Specified by:
start in interface DependentServiceExporter

stop

public void stop()
Description copied from interface: DependentServiceExporter
Stops the OSGi lifecycle. Should not throw an exception if the component is already stopped.

Specified by:
stop in interface DependentServiceExporter


Copyright © 2006-2008 Spring Framework. All Rights Reserved.