org.apache.yoko.osgi.locator
Class BundleProviderLoader

java.lang.Object
  extended by org.apache.yoko.osgi.locator.BundleProviderLoader
All Implemented Interfaces:
Comparable<BundleProviderLoader>

public class BundleProviderLoader
extends Object
implements Comparable<BundleProviderLoader>

Holder class for located services information.


Constructor Summary
BundleProviderLoader(String providerId, String providerClass, org.osgi.framework.Bundle bundle, int priority)
          Create a loader for this registered provider.
 
Method Summary
 int compareTo(BundleProviderLoader other)
           
 Object createInstance()
          Create an instance of the registred service.
 boolean equals(Object obj)
           
 int hashCode()
           
 String id()
           
 Class<?> loadClass()
          Load a provider class.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BundleProviderLoader

public BundleProviderLoader(String providerId,
                            String providerClass,
                            org.osgi.framework.Bundle bundle,
                            int priority)
Create a loader for this registered provider.

Parameters:
providerId - The provider ID
providerClass - The mapped class name of the provider.
bundle - The hosting bundle.
priority -
Method Detail

loadClass

public Class<?> loadClass()
                   throws ClassNotFoundException
Load a provider class.

Returns:
The provider class from the target bundle.
Throws:
Exception
ClassNotFoundException

createInstance

public Object createInstance()
                      throws Exception
Create an instance of the registred service.

Returns:
The created instance. A new instance is created on each call.
Throws:
Exception

id

public String id()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(BundleProviderLoader other)
Specified by:
compareTo in interface Comparable<BundleProviderLoader>


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.