org.apache.muse.core.platform.osgi.routing
Class OSGiResourceIdFactory

java.lang.Object
  extended by org.apache.muse.core.platform.osgi.routing.OSGiResourceIdFactory
All Implemented Interfaces:
ResourceIdFactory

public class OSGiResourceIdFactory
extends Object
implements ResourceIdFactory

OSGiResourceIdFactory is a simple ID factory that tracks ID values by Bundle

Author:
Joel Hawkins (joelh)
See Also:
ResourceIdFactory

Field Summary
protected  HashMap bundleToCounterMap
           
protected  String name
           
 
Constructor Summary
OSGiResourceIdFactory()
           
OSGiResourceIdFactory(String name)
           
 
Method Summary
 QName getIdentifierName()
          returns the QName for the ID factory's identifiers
 String getNextIdentifier()
          returns the next identifier as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundleToCounterMap

protected HashMap bundleToCounterMap

name

protected String name
Constructor Detail

OSGiResourceIdFactory

public OSGiResourceIdFactory()

OSGiResourceIdFactory

public OSGiResourceIdFactory(String name)
Method Detail

getIdentifierName

public QName getIdentifierName()
returns the QName for the ID factory's identifiers

Specified by:
getIdentifierName in interface ResourceIdFactory
Returns:
the factory's resource id QName

getNextIdentifier

public String getNextIdentifier()
returns the next identifier as a string. This method uses the thread local Bundle from the OSGiReflectUtilHelper as the key to find the next counter to increment if there is no active bundle, then a global counter is used

Specified by:
getNextIdentifier in interface ResourceIdFactory
Returns:
the next identifier for the current thread's Bundle
See Also:
OSGiReflectUtilHelper.getThreadLocalBundle()


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.