Method from org.apache.camel.impl.DefaultEndpoint Detail: |
public void configureProperties(Map options) {
}
|
public E convertTo(Class<E> type,
Exchange exchange) {
// TODO we could infer type parameter
if (type.isInstance(exchange)) {
return type.cast(exchange);
}
return getCamelContext().getExchangeConverter().convertTo(type, exchange);
}
Converts the given exchange to the specified exchange type |
protected String createEndpointUri() {
return null;
}
A factory method to lazily create the endpointUri if none is specified |
public E createExchange() {
return createExchange(getExchangePattern());
}
|
public E createExchange(Exchange exchange) {
Class< E > exchangeType = getExchangeType();
if (exchangeType != null) {
if (exchangeType.isInstance(exchange)) {
return exchangeType.cast(exchange);
}
}
E answer = createExchange();
answer.copyFrom(exchange);
return answer;
}
|
public E createExchange(ExchangePattern pattern) {
return (E) new DefaultExchange(getCamelContext(), pattern);
}
|
protected ScheduledThreadPoolExecutor createExecutorService() {
return new ScheduledThreadPoolExecutor(10);
}
|
public PollingConsumer<E> createPollingConsumer() throws Exception {
return new EventDrivenPollingConsumer< E >(this);
}
|
public boolean equals(Object object) {
if (object instanceof DefaultEndpoint) {
DefaultEndpoint that = (DefaultEndpoint) object;
return ObjectHelper.equal(this.getEndpointUri(), that.getEndpointUri());
}
return false;
}
|
public CamelContext getCamelContext() {
return camelContext;
}
|
public Component getComponent() {
return component;
}
|
public CamelContext getContext() {
return getCamelContext();
}
|
public String getEndpointUri() {
if (endpointUri == null) {
endpointUri = createEndpointUri();
if (endpointUri == null) {
throw new IllegalArgumentException("endpointUri is not specified and " + getClass().getName()
+ " does not implement createEndpointUri() to create a default value");
}
}
return endpointUri;
}
|
public ExchangePattern getExchangePattern() {
return exchangePattern;
}
|
public Class<E> getExchangeType() {
Type type = getClass().getGenericSuperclass();
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type[] arguments = parameterizedType.getActualTypeArguments();
if (arguments.length > 0) {
Type argumentType = arguments[0];
if (argumentType instanceof Class) {
return (Class< E >) argumentType;
}
}
}
return null;
}
Returns the type of the exchange which is generated by this component |
public synchronized ScheduledExecutorService getExecutorService() {
if (executorService == null) {
Component c = getComponent();
if (c != null && c instanceof DefaultComponent) {
DefaultComponent dc = (DefaultComponent) c;
executorService = dc.getExecutorService();
}
if (executorService == null) {
executorService = createExecutorService();
}
}
return executorService;
}
|
public int hashCode() {
return getEndpointUri().hashCode() * 37 + 1;
}
|
public boolean isLenientProperties() {
// default should be false for most components
return false;
}
|
public void setCamelContext(CamelContext camelContext) {
this.camelContext = camelContext;
}
|
public void setContext(CamelContext context) {
setCamelContext(context);
}
|
protected void setEndpointUri(String endpointUri) {
this.endpointUri = endpointUri;
}
|
public void setExchangePattern(ExchangePattern exchangePattern) {
this.exchangePattern = exchangePattern;
}
|
public synchronized void setExecutorService(ScheduledExecutorService executorService) {
this.executorService = executorService;
}
|
public String toString() {
return "Endpoint[" + getEndpointUri() + "]";
}
|