org.apache.servicemix.jbi.deployer.impl
Class AbstractInstaller

java.lang.Object
  extended by org.apache.servicemix.jbi.deployer.impl.AbstractInstaller
Direct Known Subclasses:
ComponentInstaller, ServiceAssemblyInstaller, SharedLibraryInstaller

public abstract class AbstractInstaller
extends java.lang.Object

Installers are used to controll the installation / deployment process of JBI artifacts and manage the installed OSGi bundle. TODO: refactor the use of installRoot and reuse the Deployer#jbiRootDir


Field Summary
protected  boolean autoStart
           
protected  org.osgi.framework.Bundle bundle
           
protected  Deployer deployer
           
protected  Descriptor descriptor
           
protected  java.io.File installRoot
           
protected  boolean isFirstInstall
           
protected  boolean isModified
           
protected  java.io.File jbiArtifact
           
static java.lang.String LAST_INSTALL
           
protected  org.apache.commons.logging.Log LOGGER
           
protected  boolean uninstallFromOsgi
           
 
Constructor Summary
protected AbstractInstaller(Deployer deployer, Descriptor descriptor, java.io.File jbiArtifact, boolean autoStart)
           
 
Method Summary
protected  void deletePreferences()
           
protected  void extractBundle(java.io.File installRoot, org.osgi.framework.Bundle bundle, java.lang.String path)
           
 org.osgi.framework.Bundle getBundle()
           
protected  org.osgi.framework.BundleContext getBundleContext()
           
abstract  java.lang.String getName()
           
protected  org.osgi.service.prefs.Preferences getPreferences()
           
 void init()
           
abstract  javax.management.ObjectName install()
           
 void installBundle()
           
 boolean isAutoStart()
           
 boolean isUninstallFromOsgi()
           
protected  void postInstall()
           
 void setAutoStart(boolean autoStart)
           
 void setBundle(org.osgi.framework.Bundle bundle)
           
 void setUninstallFromOsgi(boolean uninstallFromOsgi)
           
abstract  void stop(boolean force)
           
abstract  void uninstall(boolean force)
           
protected  void uninstallBundle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAST_INSTALL

public static final java.lang.String LAST_INSTALL
See Also:
Constant Field Values

LOGGER

protected final org.apache.commons.logging.Log LOGGER

deployer

protected Deployer deployer

descriptor

protected Descriptor descriptor

bundle

protected org.osgi.framework.Bundle bundle

autoStart

protected boolean autoStart

jbiArtifact

protected java.io.File jbiArtifact

installRoot

protected java.io.File installRoot

uninstallFromOsgi

protected boolean uninstallFromOsgi

isFirstInstall

protected boolean isFirstInstall

isModified

protected boolean isModified
Constructor Detail

AbstractInstaller

protected AbstractInstaller(Deployer deployer,
                            Descriptor descriptor,
                            java.io.File jbiArtifact,
                            boolean autoStart)
Method Detail

setBundle

public void setBundle(org.osgi.framework.Bundle bundle)

getBundle

public org.osgi.framework.Bundle getBundle()

getBundleContext

protected org.osgi.framework.BundleContext getBundleContext()

getName

public abstract java.lang.String getName()

init

public void init()
          throws java.lang.Exception
Throws:
java.lang.Exception

postInstall

protected void postInstall()
                    throws java.lang.Exception
Throws:
java.lang.Exception

install

public abstract javax.management.ObjectName install()
                                             throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

stop

public abstract void stop(boolean force)
                   throws java.lang.Exception
Throws:
java.lang.Exception

uninstall

public abstract void uninstall(boolean force)
                        throws java.lang.Exception
Throws:
java.lang.Exception

installBundle

public void installBundle()
                   throws java.lang.Exception
Throws:
java.lang.Exception

uninstallBundle

protected void uninstallBundle()
                        throws org.osgi.framework.BundleException
Throws:
org.osgi.framework.BundleException

getPreferences

protected org.osgi.service.prefs.Preferences getPreferences()

deletePreferences

protected void deletePreferences()
                          throws org.osgi.service.prefs.BackingStoreException
Throws:
org.osgi.service.prefs.BackingStoreException

isAutoStart

public boolean isAutoStart()

setAutoStart

public void setAutoStart(boolean autoStart)

isUninstallFromOsgi

public boolean isUninstallFromOsgi()

setUninstallFromOsgi

public void setUninstallFromOsgi(boolean uninstallFromOsgi)

extractBundle

protected void extractBundle(java.io.File installRoot,
                             org.osgi.framework.Bundle bundle,
                             java.lang.String path)
                      throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.