|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.util.CamelContextHelper
public final class CamelContextHelper
A number of helper methods
Field Summary | |
---|---|
static String |
COMPONENT_DESCRIPTOR
|
static String |
COMPONENT_DOCUMENTATION_PREFIX
|
Method Summary | ||
---|---|---|
static
|
convertTo(CamelContext context,
Class<T> type,
Object value)
Converts the given value to the requested type |
|
static SortedMap<String,Properties> |
findComponents(CamelContext camelContext)
Finds all possible Components on the classpath and Registry |
|
static SortedMap<String,Properties> |
findComponents(CamelContext camelContext,
Enumeration<URL> componentDescriptionIter)
|
|
static Endpoint |
getEndpointInjection(CamelContext camelContext,
String uri,
String ref,
String injectionPointName,
boolean mandatory)
Evaluates the @EndpointInject annotation using the given context |
|
static Endpoint |
getMandatoryEndpoint(CamelContext camelContext,
String uri)
Returns the mandatory endpoint for the given URI or the NoSuchEndpointException is thrown |
|
static
|
getMandatoryEndpoint(CamelContext camelContext,
String uri,
Class<T> type)
Returns the mandatory endpoint for the given URI and type or the NoSuchEndpointException is thrown |
|
static int |
getMaximumCachePoolSize(CamelContext camelContext)
Gets the maximum cache pool size. |
|
static int |
getMaximumEndpointCacheSize(CamelContext camelContext)
Gets the maximum endpoint cache size. |
|
static int |
getRouteStartupOrder(CamelContext camelContext,
String routeId)
Gets the route startup order for the given route id |
|
static Object |
lookup(CamelContext context,
String name)
Look up the given named bean in the Registry on the
CamelContext |
|
static
|
lookup(CamelContext context,
String name,
Class<T> beanType)
Look up the given named bean of the given type in the Registry on the
CamelContext |
|
static
|
mandatoryConvertTo(CamelContext context,
Class<T> type,
Object value)
Converts the given value to the specified type throwing an IllegalArgumentException
if the value could not be converted to a non null value |
|
static Object |
mandatoryLookup(CamelContext context,
String name)
Look up the given named bean in the Registry on the
CamelContext or throws NoSuchBeanException if not found. |
|
static
|
mandatoryLookup(CamelContext context,
String name,
Class<T> beanType)
Look up the given named bean of the given type in the Registry on the
CamelContext or throws NoSuchBeanException if not found. |
|
static
|
newInstance(CamelContext context,
Class<T> beanType)
Creates a new instance of the given type using the Injector on the given
CamelContext |
|
static Boolean |
parseBoolean(CamelContext camelContext,
String text)
Parses the given text and converts it to an Boolean and handling property placeholders as well |
|
static Double |
parseDouble(CamelContext camelContext,
String text)
Parses the given text and converts it to a Double and handling property placeholders as well |
|
static Integer |
parseInteger(CamelContext camelContext,
String text)
Parses the given text and converts it to an Integer and handling property placeholders as well |
|
static Long |
parseLong(CamelContext camelContext,
String text)
Parses the given text and converts it to an Long and handling property placeholders as well |
|
static String |
parseText(CamelContext camelContext,
String text)
Parses the given text and handling property placeholders as well |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_DESCRIPTOR
public static final String COMPONENT_DOCUMENTATION_PREFIX
Method Detail |
---|
public static Endpoint getMandatoryEndpoint(CamelContext camelContext, String uri) throws NoSuchEndpointException
NoSuchEndpointException
is thrown
NoSuchEndpointException
public static <T extends Endpoint> T getMandatoryEndpoint(CamelContext camelContext, String uri, Class<T> type)
NoSuchEndpointException
is thrown
public static <T> T convertTo(CamelContext context, Class<T> type, Object value)
public static <T> T mandatoryConvertTo(CamelContext context, Class<T> type, Object value)
IllegalArgumentException
if the value could not be converted to a non null value
public static <T> T newInstance(CamelContext context, Class<T> beanType)
Injector
on the given
CamelContext
public static Object lookup(CamelContext context, String name)
Registry
on the
CamelContext
public static <T> T lookup(CamelContext context, String name, Class<T> beanType)
Registry
on the
CamelContext
public static Object mandatoryLookup(CamelContext context, String name)
Registry
on the
CamelContext
or throws NoSuchBeanException
if not found.
public static <T> T mandatoryLookup(CamelContext context, String name, Class<T> beanType)
Registry
on the
CamelContext
or throws NoSuchBeanException if not found.
public static Endpoint getEndpointInjection(CamelContext camelContext, String uri, String ref, String injectionPointName, boolean mandatory)
public static int getMaximumCachePoolSize(CamelContext camelContext) throws IllegalArgumentException
Exchange.MAXIMUM_CACHE_POOL_SIZE
.
If no property has been set, then it will fallback to return a size of 1000.
camelContext
- the camel context
IllegalArgumentException
- is thrown if the property is illegalpublic static int getMaximumEndpointCacheSize(CamelContext camelContext) throws IllegalArgumentException
Exchange.MAXIMUM_ENDPOINT_CACHE_SIZE
.
If no property has been set, then it will fallback to return a size of 1000.
camelContext
- the camel context
IllegalArgumentException
- is thrown if the property is illegalpublic static String parseText(CamelContext camelContext, String text) throws Exception
camelContext
- the camel contexttext
- the text
Exception
- is thrown if illegal argumentpublic static Integer parseInteger(CamelContext camelContext, String text) throws Exception
camelContext
- the camel contexttext
- the text
Exception
- is thrown if illegal argument or type conversion not possiblepublic static Long parseLong(CamelContext camelContext, String text) throws Exception
camelContext
- the camel contexttext
- the text
Exception
- is thrown if illegal argument or type conversion not possiblepublic static Double parseDouble(CamelContext camelContext, String text) throws Exception
camelContext
- the camel contexttext
- the text
Exception
- is thrown if illegal argument or type conversion not possiblepublic static Boolean parseBoolean(CamelContext camelContext, String text) throws Exception
camelContext
- the camel contexttext
- the text
Exception
- is thrown if illegal argument or type conversion not possiblepublic static SortedMap<String,Properties> findComponents(CamelContext camelContext) throws LoadPropertiesException
LoadPropertiesException
public static SortedMap<String,Properties> findComponents(CamelContext camelContext, Enumeration<URL> componentDescriptionIter) throws LoadPropertiesException
LoadPropertiesException
public static int getRouteStartupOrder(CamelContext camelContext, String routeId)
camelContext
- the camel contextrouteId
- the id of the route
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |