org.apache.camel.core.osgi
Class OsgiTypeConverter
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.core.osgi.OsgiTypeConverter
- All Implemented Interfaces:
- Service, ShutdownableService, TypeConverter, org.osgi.util.tracker.ServiceTrackerCustomizer
public class OsgiTypeConverter
- extends ServiceSupport
- implements TypeConverter, org.osgi.util.tracker.ServiceTrackerCustomizer
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doShutdown, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, shutdown, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OsgiTypeConverter
public OsgiTypeConverter(org.osgi.framework.BundleContext bundleContext,
Injector injector)
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 ServiceSupport
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Specified by:
doStop in class ServiceSupport
- Throws:
Exception
convertTo
public <T> T convertTo(Class<T> type,
Object value)
- Description copied from interface:
TypeConverter
- Converts the value to the specified type
- Specified by:
convertTo in interface TypeConverter
- Parameters:
type - the requested typevalue - the value to be converted
- Returns:
- the converted value, or null if not possible to convert
convertTo
public <T> T convertTo(Class<T> type,
Exchange exchange,
Object value)
- Description copied from interface:
TypeConverter
- Converts the value to the specified type in the context of an exchange
Used when conversion requires extra information from the current
exchange (such as encoding).
- Specified by:
convertTo in interface TypeConverter
- Parameters:
type - the requested typeexchange - the current exchangevalue - the value to be converted
- Returns:
- the converted value, or null if not possible to convert
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type,
Object value)
throws NoTypeConversionAvailableException
- Description copied from interface:
TypeConverter
- Converts the value to the specified type
- Specified by:
mandatoryConvertTo in interface TypeConverter
- Parameters:
type - the requested typevalue - the value to be converted
- Returns:
- the converted value, is never null
- Throws:
NoTypeConversionAvailableException - if conversion not possible
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type,
Exchange exchange,
Object value)
throws NoTypeConversionAvailableException
- Description copied from interface:
TypeConverter
- Converts the value to the specified type in the context of an exchange
Used when conversion requires extra information from the current
exchange (such as encoding).
- Specified by:
mandatoryConvertTo in interface TypeConverter
- Parameters:
type - the requested typeexchange - the current exchangevalue - the value to be converted
- Returns:
- the converted value, is never null
- Throws:
NoTypeConversionAvailableException
getRegistry
public DefaultTypeConverter getRegistry()
createRegistry
protected DefaultTypeConverter createRegistry()
Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.