You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/05/12 08:59:07 UTC
svn commit: r943393 - in
/camel/trunk/camel-core/src/main/java/org/apache/camel: CamelContext.java
impl/DefaultCamelContext.java spi/FactoryFinderResolver.java
Author: davsclaus
Date: Wed May 12 06:59:07 2010
New Revision: 943393
URL: http://svn.apache.org/viewvc?rev=943393&view=rev
Log:
Removed @deprecated methods. Polished javadoc.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/FactoryFinderResolver.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java?rev=943393&r1=943392&r2=943393&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelContext.java Wed May 12 06:59:07 2010
@@ -146,18 +146,6 @@ public interface CamelContext extends Se
*/
Component removeComponent(String componentName);
- /**
- * Gets the a previously added component by name or lazily creates the component
- * using the factory Callback.
- *
- * @param componentName the name of the component
- * @param factory used to create a new component instance if the component was not previously added.
- * @return the component
- * @deprecated will be removed in Camel 2.3.
- */
- @Deprecated
- Component getOrCreateComponent(String componentName, Callable<Component> factory);
-
// Endpoint Management Methods
//-----------------------------------------------------------------------
@@ -206,26 +194,6 @@ public interface CamelContext extends Se
Endpoint hasEndpoint(String uri);
/**
- * Returns the collection of all registered endpoints for a uri or an empty collection.
- * For a singleton endpoint the collection will contain exactly one element.
- *
- * @param uri the URI of the endpoints
- * @return collection of endpoints
- * @deprecated not used will be removed in Camel 2.3.
- */
- @Deprecated
- Collection<Endpoint> getEndpoints(String uri);
-
- /**
- * Returns the collection of all registered singleton endpoints.
- *
- * @return all the singleton endpoints
- * @deprecated not used will be removed in Camel 2.3.
- */
- @Deprecated
- Collection<Endpoint> getSingletonEndpoints();
-
- /**
* Adds the endpoint to the context using the given URI.
*
* @param uri the URI to be used to resolve this endpoint
@@ -236,17 +204,6 @@ public interface CamelContext extends Se
Endpoint addEndpoint(String uri, Endpoint endpoint) throws Exception;
/**
- * Removes all endpoints with the given URI
- *
- * @param uri the URI to be used to remove
- * @return a collection of endpoints removed or null if there are no endpoints for this URI
- * @throws Exception if at least one endpoint could not be stopped
- * @deprecated not used will be removed in Camel 2.3.
- */
- @Deprecated
- Collection<Endpoint> removeEndpoints(String uri) throws Exception;
-
- /**
* Registers a {@link org.apache.camel.spi.EndpointStrategy callback} to allow you to do custom
* logic when an {@link Endpoint} is about to be registered to the {@link CamelContext} endpoint registry.
* <p/>
@@ -381,16 +338,6 @@ public interface CamelContext extends Se
*/
ServiceStatus getRouteStatus(String routeId);
- /**
- * Returns the current status of the given route
- *
- * @param route the route
- * @return the status for the route
- * @deprecated will be removed in Camel 2.3.
- */
- @Deprecated
- ServiceStatus getRouteStatus(RouteDefinition route);
-
// Properties
//-----------------------------------------------------------------------
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=943393&r1=943392&r2=943393&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java Wed May 12 06:59:07 2010
@@ -274,30 +274,6 @@ public class DefaultCamelContext extends
}
}
- public Component getOrCreateComponent(String componentName, Callable<Component> factory) {
- synchronized (components) {
- Component component = components.get(componentName);
- if (component == null) {
- try {
- component = factory.call();
- if (component == null) {
- throw new RuntimeCamelException("Factory failed to create the " + componentName
- + " component, it returned null.");
- }
- components.put(componentName, component);
- component.setCamelContext(this);
- for (LifecycleStrategy strategy : lifecycleStrategies) {
- strategy.onComponentAdd(componentName, component);
- }
- } catch (Exception e) {
- throw new RuntimeCamelException("Factory failed to create the " + componentName
- + " component.", e);
- }
- }
- return component;
- }
- }
-
// Endpoint Management Methods
// -----------------------------------------------------------------------
@@ -325,36 +301,6 @@ public class DefaultCamelContext extends
}
}
- public Collection<Endpoint> getEndpoints(String uri) {
- Collection<Endpoint> answer = new ArrayList<Endpoint>();
- Collection<Endpoint> coll;
- synchronized (endpoints) {
- Endpoint ep = endpoints.get(uri);
- if (ep != null) {
- answer.add(ep);
- return answer;
- }
- coll = new ArrayList<Endpoint>(endpoints.values());
- }
- for (Endpoint ep : coll) {
- if (!ep.isSingleton() && uri.equals(ep.getEndpointUri())) {
- answer.add(ep);
- }
- }
- return answer;
- }
-
- public Collection<Endpoint> getSingletonEndpoints() {
- Collection<Endpoint> answer = new ArrayList<Endpoint>();
- Collection<Endpoint> coll = getEndpoints();
- for (Endpoint ep : coll) {
- if (ep.isSingleton()) {
- answer.add(ep);
- }
- }
- return answer;
- }
-
public Endpoint addEndpoint(String uri, Endpoint endpoint) throws Exception {
Endpoint oldEndpoint;
synchronized (endpoints) {
@@ -371,40 +317,6 @@ public class DefaultCamelContext extends
return oldEndpoint;
}
- public Collection<Endpoint> removeEndpoints(String uri) throws Exception {
- Collection<Endpoint> answer = new ArrayList<Endpoint>();
- synchronized (endpoints) {
- Endpoint oldEndpoint = endpoints.remove(uri);
- if (oldEndpoint != null) {
- answer.add(oldEndpoint);
- stopServices(oldEndpoint);
- for (LifecycleStrategy strategy : lifecycleStrategies) {
- strategy.onEndpointRemove(oldEndpoint);
- }
- } else {
- Collection<Map.Entry<String, Endpoint>> worklist = new ArrayList<Map.Entry<String, Endpoint>>();
- for (Map.Entry<String, Endpoint> entry : endpoints.entrySet()) {
- oldEndpoint = entry.getValue();
- if (!oldEndpoint.isSingleton() && uri.equals(oldEndpoint.getEndpointUri())) {
- // add to worklist to avoid concurrent modification exception
- worklist.add(entry);
- }
- }
- for (Map.Entry<String, Endpoint> entry : worklist) {
- oldEndpoint = entry.getValue();
- answer.add(oldEndpoint);
- stopServices(oldEndpoint);
- endpoints.remove(entry.getKey());
- for (LifecycleStrategy strategy : lifecycleStrategies) {
- strategy.onEndpointRemove(oldEndpoint);
- }
- }
-
- }
- }
- return answer;
- }
-
public Endpoint getEndpoint(String uri) {
ObjectHelper.notEmpty(uri, "uri");
@@ -620,10 +532,6 @@ public class DefaultCamelContext extends
removeRouteDefinition(key);
}
- public ServiceStatus getRouteStatus(RouteDefinition route) {
- return getRouteStatus(route.idOrCreate(nodeIdFactory));
- }
-
public ServiceStatus getRouteStatus(String key) {
RouteService routeService = routeServices.get(key);
if (routeService != null) {
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/spi/FactoryFinderResolver.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/spi/FactoryFinderResolver.java?rev=943393&r1=943392&r2=943393&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/spi/FactoryFinderResolver.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/spi/FactoryFinderResolver.java Wed May 12 06:59:07 2010
@@ -17,7 +17,7 @@
package org.apache.camel.spi;
/**
- * Represents a resolver of FactoryFinder to
+ * Represents a resolver for {@link FactoryFinder}
*
* @version $Revision$
*/