|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.util.CamelContextHelper
public final class CamelContextHelper
A number of helper methods
Method Summary | ||
---|---|---|
static
|
convertTo(CamelContext context,
java.lang.Class<T> type,
java.lang.Object value)
Converts the given value to the requested type |
|
static Endpoint |
getEndpointInjection(CamelContext camelContext,
java.lang.String uri,
java.lang.String ref,
java.lang.String injectionPointName,
boolean mandatory)
Evaluates the @EndpointInject annotation using the given context |
|
static Endpoint |
getMandatoryEndpoint(CamelContext camelContext,
java.lang.String uri)
Returns the mandatory endpoint for the given URI or the NoSuchEndpointException is thrown |
|
static
|
getMandatoryEndpoint(CamelContext camelContext,
java.lang.String uri,
java.lang.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 java.lang.Object |
lookup(CamelContext context,
java.lang.String name)
Look up the given named bean in the Registry on the
CamelContext |
|
static
|
lookup(CamelContext context,
java.lang.String name,
java.lang.Class<T> beanType)
Look up the given named bean of the given type in the Registry on the
CamelContext |
|
static
|
mandatoryConvertTo(CamelContext context,
java.lang.Class<T> type,
java.lang.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 java.lang.Object |
mandatoryLookup(CamelContext context,
java.lang.String name)
Look up the given named bean in the Registry on the
CamelContext or throws NoSuchBeanException if not found. |
|
static
|
mandatoryLookup(CamelContext context,
java.lang.String name,
java.lang.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,
java.lang.Class<T> beanType)
Creates a new instance of the given type using the Injector on the given
CamelContext |
|
static java.lang.Boolean |
parseBoolean(CamelContext camelContext,
java.lang.String text)
Parses the given text and converts it to an Boolean and handling property placeholders as well |
|
static java.lang.Double |
parseDouble(CamelContext camelContext,
java.lang.String text)
Parses the given text and converts it to a Double and handling property placeholders as well |
|
static java.lang.Integer |
parseInteger(CamelContext camelContext,
java.lang.String text)
Parses the given text and converts it to an Integer and handling property placeholders as well |
|
static java.lang.Long |
parseLong(CamelContext camelContext,
java.lang.String text)
Parses the given text and converts it to an Long and handling property placeholders as well |
|
static java.lang.String |
parseText(CamelContext camelContext,
java.lang.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 |
Method Detail |
---|
public static Endpoint getMandatoryEndpoint(CamelContext camelContext, java.lang.String uri) throws NoSuchEndpointException
NoSuchEndpointException
is thrown
NoSuchEndpointException
public static <T extends Endpoint> T getMandatoryEndpoint(CamelContext camelContext, java.lang.String uri, java.lang.Class<T> type)
NoSuchEndpointException
is thrown
public static <T> T convertTo(CamelContext context, java.lang.Class<T> type, java.lang.Object value)
public static <T> T mandatoryConvertTo(CamelContext context, java.lang.Class<T> type, java.lang.Object value)
IllegalArgumentException
if the value could not be converted to a non null value
public static <T> T newInstance(CamelContext context, java.lang.Class<T> beanType)
Injector
on the given
CamelContext
public static java.lang.Object lookup(CamelContext context, java.lang.String name)
Registry
on the
CamelContext
public static <T> T lookup(CamelContext context, java.lang.String name, java.lang.Class<T> beanType)
Registry
on the
CamelContext
public static java.lang.Object mandatoryLookup(CamelContext context, java.lang.String name)
Registry
on the
CamelContext
or throws NoSuchBeanException if not found.
public static <T> T mandatoryLookup(CamelContext context, java.lang.String name, java.lang.Class<T> beanType)
Registry
on the
CamelContext
or throws NoSuchBeanException if not found.
public static Endpoint getEndpointInjection(CamelContext camelContext, java.lang.String uri, java.lang.String ref, java.lang.String injectionPointName, boolean mandatory)
public static int getMaximumCachePoolSize(CamelContext camelContext) throws java.lang.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
java.lang.IllegalArgumentException
- is thrown if the property is illegalpublic static int getMaximumEndpointCacheSize(CamelContext camelContext) throws java.lang.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
java.lang.IllegalArgumentException
- is thrown if the property is illegalpublic static java.lang.String parseText(CamelContext camelContext, java.lang.String text) throws java.lang.Exception
camelContext
- the camel contexttext
- the text
java.lang.Exception
- is thrown if illegal argumentpublic static java.lang.Integer parseInteger(CamelContext camelContext, java.lang.String text) throws java.lang.Exception
camelContext
- the camel contexttext
- the text
java.lang.Exception
- is thrown if illegal argument or type conversion not possiblepublic static java.lang.Long parseLong(CamelContext camelContext, java.lang.String text) throws java.lang.Exception
camelContext
- the camel contexttext
- the text
java.lang.Exception
- is thrown if illegal argument or type conversion not possiblepublic static java.lang.Double parseDouble(CamelContext camelContext, java.lang.String text) throws java.lang.Exception
camelContext
- the camel contexttext
- the text
java.lang.Exception
- is thrown if illegal argument or type conversion not possiblepublic static java.lang.Boolean parseBoolean(CamelContext camelContext, java.lang.String text) throws java.lang.Exception
camelContext
- the camel contexttext
- the text
java.lang.Exception
- is thrown if illegal argument or type conversion not possible
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |