org.apache.camel.core.osgi
Class OsgiTypeConverter

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.core.osgi.OsgiTypeConverter
All Implemented Interfaces:
org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.TypeConverterRegistry, org.apache.camel.StatefulService, org.apache.camel.SuspendableService, org.apache.camel.TypeConverter, org.osgi.util.tracker.ServiceTrackerCustomizer

public class OsgiTypeConverter
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.TypeConverter, org.apache.camel.spi.TypeConverterRegistry, org.osgi.util.tracker.ServiceTrackerCustomizer


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.camel.spi.TypeConverterRegistry
org.apache.camel.spi.TypeConverterRegistry.Statistics
 
Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
OsgiTypeConverter(org.osgi.framework.BundleContext bundleContext, org.apache.camel.spi.Injector injector, org.apache.camel.spi.FactoryFinder factoryFinder)
           
 
Method Summary
 void addFallbackTypeConverter(org.apache.camel.TypeConverter typeConverter, boolean canPromote)
           
 Object addingService(org.osgi.framework.ServiceReference serviceReference)
           
 void addTypeConverter(Class<?> toType, Class<?> fromType, org.apache.camel.TypeConverter typeConverter)
           
<T> T
convertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
convertTo(Class<T> type, Object value)
           
protected  org.apache.camel.impl.converter.DefaultTypeConverter createRegistry()
           
protected  void doStart()
           
protected  void doStop()
           
 org.apache.camel.impl.converter.DefaultTypeConverter getDelegate()
           
 org.apache.camel.spi.Injector getInjector()
           
 org.apache.camel.spi.TypeConverterRegistry.Statistics getStatistics()
           
 org.apache.camel.TypeConverter lookup(Class<?> toType, Class<?> fromType)
           
<T> T
mandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
mandatoryConvertTo(Class<T> type, Object value)
           
 void modifiedService(org.osgi.framework.ServiceReference serviceReference, Object o)
           
 void removedService(org.osgi.framework.ServiceReference serviceReference, Object o)
           
 void setInjector(org.apache.camel.spi.Injector injector)
           
<T> T
tryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
           
<T> T
tryConvertTo(Class<T> type, Object value)
           
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

OsgiTypeConverter

public OsgiTypeConverter(org.osgi.framework.BundleContext bundleContext,
                         org.apache.camel.spi.Injector injector,
                         org.apache.camel.spi.FactoryFinder factoryFinder)
Method Detail

addingService

public Object addingService(org.osgi.framework.ServiceReference serviceReference)
Specified by:
addingService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

modifiedService

public void modifiedService(org.osgi.framework.ServiceReference serviceReference,
                            Object o)
Specified by:
modifiedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

removedService

public void removedService(org.osgi.framework.ServiceReference serviceReference,
                           Object o)
Specified by:
removedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class org.apache.camel.support.ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class org.apache.camel.support.ServiceSupport
Throws:
Exception

convertTo

public <T> T convertTo(Class<T> type,
                       Object value)
Specified by:
convertTo in interface org.apache.camel.TypeConverter

convertTo

public <T> T convertTo(Class<T> type,
                       org.apache.camel.Exchange exchange,
                       Object value)
Specified by:
convertTo in interface org.apache.camel.TypeConverter

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                Object value)
                     throws org.apache.camel.NoTypeConversionAvailableException
Specified by:
mandatoryConvertTo in interface org.apache.camel.TypeConverter
Throws:
org.apache.camel.NoTypeConversionAvailableException

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                org.apache.camel.Exchange exchange,
                                Object value)
                     throws org.apache.camel.NoTypeConversionAvailableException
Specified by:
mandatoryConvertTo in interface org.apache.camel.TypeConverter
Throws:
org.apache.camel.NoTypeConversionAvailableException

tryConvertTo

public <T> T tryConvertTo(Class<T> type,
                          org.apache.camel.Exchange exchange,
                          Object value)
Specified by:
tryConvertTo in interface org.apache.camel.TypeConverter

tryConvertTo

public <T> T tryConvertTo(Class<T> type,
                          Object value)
Specified by:
tryConvertTo in interface org.apache.camel.TypeConverter

addTypeConverter

public void addTypeConverter(Class<?> toType,
                             Class<?> fromType,
                             org.apache.camel.TypeConverter typeConverter)
Specified by:
addTypeConverter in interface org.apache.camel.spi.TypeConverterRegistry

addFallbackTypeConverter

public void addFallbackTypeConverter(org.apache.camel.TypeConverter typeConverter,
                                     boolean canPromote)
Specified by:
addFallbackTypeConverter in interface org.apache.camel.spi.TypeConverterRegistry

lookup

public org.apache.camel.TypeConverter lookup(Class<?> toType,
                                             Class<?> fromType)
Specified by:
lookup in interface org.apache.camel.spi.TypeConverterRegistry

setInjector

public void setInjector(org.apache.camel.spi.Injector injector)
Specified by:
setInjector in interface org.apache.camel.spi.TypeConverterRegistry

getInjector

public org.apache.camel.spi.Injector getInjector()
Specified by:
getInjector in interface org.apache.camel.spi.TypeConverterRegistry

getStatistics

public org.apache.camel.spi.TypeConverterRegistry.Statistics getStatistics()
Specified by:
getStatistics in interface org.apache.camel.spi.TypeConverterRegistry

getDelegate

public org.apache.camel.impl.converter.DefaultTypeConverter getDelegate()

createRegistry

protected org.apache.camel.impl.converter.DefaultTypeConverter createRegistry()


Apache CAMEL