Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a2cce14
CAMEL-4817 Added camel-gora component with thanks to Ioannis
WillemJiang Nov 19, 2013
0d16dc7
Fixed the CS errors of camel-gora
WillemJiang Nov 19, 2013
92386b5
CAMEL-4817 fixed some log issue of camel-gora
WillemJiang Nov 19, 2013
76e3533
CAMEL-4817 move the version properties into parent/pom.xml
WillemJiang Nov 19, 2013
be25f31
CAMEL-6974 Added this Missing fields in RestResources DTO of Salesfor…
WillemJiang Nov 19, 2013
55db9df
Polish the test code of SSLContextParametersTest
WillemJiang Nov 19, 2013
938dcf4
CAMEL-6971 Added the get method of schemaLocations
WillemJiang Nov 19, 2013
43d31bd
CAMEL-6792: Added CamelManagementName attribute to mbeans that had Ca…
davsclaus Nov 18, 2013
cd15fb3
Aligned pom.xml with the other components.
davsclaus Nov 18, 2013
8d7aa62
CAMEL-6972: Improved Camel in OSGi MBean naming to use symbolicName a…
davsclaus Nov 18, 2013
29ea645
CAMEL-6973: Add a simple expression for null
elakito Nov 18, 2013
812e684
a minor change to the test for CAMEL-6973
elakito Nov 19, 2013
dad131b
CAMEL-9680: Camel Karaf commands now output commands sorted and auto …
davsclaus Nov 19, 2013
c55e3a6
Fixed spelling
davsclaus Nov 19, 2013
bebc386
CAMEL-6972: Improved Camel in OSGi MBean naming to use symbolicName a…
davsclaus Nov 19, 2013
ebe358c
CAMEL-6972: Improved Camel in OSGi MBean naming to use symbolicName a…
davsclaus Nov 19, 2013
2659fe1
CAMEL-6981: Include customId attribute in route model XML so we can k…
davsclaus Nov 19, 2013
edff485
CAMEL-6982: Nicer Camel Karaf commands output for table data.
davsclaus Nov 19, 2013
ba0e038
CAMEL-6972: Improved Camel in OSGi MBean naming to use symbolicName a…
davsclaus Nov 19, 2013
7f28aa7
CAMEL-6878. Include Content-Type in the cxf header map.
hzbarcea Nov 19, 2013
3c595f4
[CAMEL-6983] Be sure to get the PaxLoggingEvent properties from the l…
jbonofre Nov 19, 2013
d801f11
Polished the README.txt of Twitter Websocket Blueprint Example.
bvahdat Nov 20, 2013
40868d5
CAMEL-6973: Corrected the copy/paste typo inside the Javadoc.
bvahdat Nov 20, 2013
10de35e
CAMEL-6985: Clean-up the codebase of the Karaf commands. See the JIRA…
bvahdat Nov 20, 2013
0f1afe8
properly close datastore on doStop, create configuration upon start o…
ipolyzos Dec 8, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ public interface ManagedComponentMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public interface ManagedEndpointMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Endpoint URI", mask = true)
String getEndpointUri();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public interface ManagedErrorHandlerMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Does the error handler support redelivery")
boolean isSupportRedelivery();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public interface ManagedProcessorMBean extends ManagedPerformanceCounterMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Route ID")
String getRouteId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@

public interface ManagedResourceEndpointMBean {

@ManagedAttribute(description = "Camel context ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Endpoint service state")
String getState();

@ManagedAttribute(description = "Whether the content is cached")
boolean isContentCache();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public interface ManagedRouteMBean extends ManagedPerformanceCounterMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Tracing")
Boolean getTracing();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public interface ManagedServiceMBean {
@ManagedAttribute(description = "Camel ID")
String getCamelId();

@ManagedAttribute(description = "Camel ManagementName")
String getCamelManagementName();

@ManagedAttribute(description = "Route ID")
String getRouteId();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,22 @@ public String toString() {
};
}

/**
* Returns the expression for the {@code null} value
*/
public static Expression nullExpression() {
return new ExpressionAdapter() {
public Object evaluate(Exchange exchange) {
return null;
}

@Override
public String toString() {
return "null";
}
};
}

/**
* Returns the expression for the exchanges inbound message body converted
* to the given type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ public boolean isContentCacheCleared() {
return buffer == null;
}

@ManagedAttribute(description = "Camel context ID")
public String getCamelId() {
return getCamelContext().getName();
}

@ManagedAttribute(description = "Camel ManagementName")
public String getCamelManagementName() {
return getCamelContext().getManagementName();
}

@ManagedAttribute(description = "Endpoint service state")
public String getState() {
return getStatus().name();
}

/**
* Sets whether to use resource content cache or not - default is <tt>false</tt>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,16 @@ public String browseRangeMessagesAsXml(Integer fromIndex, Integer toIndex, Boole
return EndpointHelper.browseRangeMessagesAsXml(this, fromIndex, toIndex, includeBody);
}

@ManagedAttribute(description = "Camel context name")
@ManagedAttribute(description = "Camel context ID")
public String getCamelId() {
return getCamelContext().getName();
}

@ManagedAttribute(description = "Camel ManagementName")
public String getCamelManagementName() {
return getCamelContext().getManagementName();
}

@ManagedAttribute(description = "Endpoint service state")
public String getState() {
return getStatus().name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ public String getCamelId() {
return this.getCamelContext().getName();
}

@ManagedAttribute(description = "Camel ManagementName")
public String getCamelManagementName() {
return this.getCamelContext().getManagementName();
}

@ManagedAttribute(description = "Endpoint Uri")
public String getEndpointUri() {
return super.getEndpointUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public String getCamelId() {
return getCamelContext().getName();
}

@ManagedAttribute(description = "Camel ManagementName")
public String getCamelManagementName() {
return getCamelContext().getManagementName();
}

public XsltEndpoint findOrCreateEndpoint(String uri, String newResourceUri) {
String newUri = uri.replace(resourceUri, newResourceUri);
LOG.trace("Getting endpoint with URI: {}", newUri);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public boolean isFixedName() {
}

public static int getNextCounter() {
// we want to start counting from 1, so increment first
return CONTEXT_COUNTER.incrementAndGet();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ private Expression createSimpleExpressionDirectly(String expression) {
return ExpressionBuilder.camelContextNameExpression();
} else if (ObjectHelper.equal(expression, "routeId")) {
return ExpressionBuilder.routeIdExpression();
} else if (ObjectHelper.equal(expression, "null")) {
return ExpressionBuilder.nullExpression();
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public String getCamelId() {
return component.getCamelContext().getName();
}

public String getCamelManagementName() {
return component.getCamelContext().getManagementName();
}

public Object getInstance() {
return component;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public String getCamelId() {
return endpoint.getCamelContext().getName();
}

@Override
public String getCamelManagementName() {
return endpoint.getCamelContext().getManagementName();
}

@Override
public String getEndpointUri() {
return endpoint.getEndpointUri();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public String getCamelId() {
return routeContext.getCamelContext().getName();
}

public String getCamelManagementName() {
return routeContext.getCamelContext().getManagementName();
}

public boolean isSupportRedelivery() {
return errorHandler instanceof RedeliveryErrorHandler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public String getCamelId() {
return context.getName();
}

public String getCamelManagementName() {
return context.getManagementName();
}

public String getRouteId() {
if (route != null) {
return route.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public String getCamelId() {
return context.getName();
}

public String getCamelManagementName() {
return context.getManagementName();
}

public Boolean getTracing() {
return route.getRouteContext().isTracing();
}
Expand Down Expand Up @@ -232,7 +236,7 @@ public void updateRouteFromXml(String xml) throws Exception {

public String dumpRouteStatsAsXml(boolean fullStats, boolean includeProcessors) throws Exception {
// in this logic we need to calculate the accumulated processing time for the processor in the route
// and hence why the logic is a bit more complicated to do this, as we need to caculate that from
// and hence why the logic is a bit more complicated to do this, as we need to calculate that from
// the bottom -> top of the route but this information is valuable for profiling routes
StringBuilder sb = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public String getCamelId() {
return context.getName();
}

public String getCamelManagementName() {
return context.getManagementName();
}

public String getRouteId() {
if (route != null) {
return route.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import org.apache.camel.NamedNode;
Expand All @@ -35,8 +34,7 @@
@XmlAccessorType(XmlAccessType.PROPERTY)
public abstract class OptionalIdentifiedDefinition<T extends OptionalIdentifiedDefinition<T>> implements NamedNode {
private String id;
@XmlTransient
private boolean customId;
private Boolean customId;
private DescriptionDefinition description;

/**
Expand Down Expand Up @@ -128,11 +126,20 @@ public String idOrCreate(NodeIdFactory factory) {
return getId();
}

public Boolean isCustomId() {
return customId;
}

@XmlAttribute
public void setCustomId(Boolean customId) {
this.customId = customId;
}

/**
* Returns whether a custom id has been assigned
*/
public boolean hasCustomIdAssigned() {
return customId;
return customId != null && customId;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public void testConstantExpression() throws Exception {
assertExpression("Hello World", "Hello World");
}

public void testNull() throws Exception {
assertNull(SimpleLanguage.simple("${null}").evaluate(exchange, Object.class));
}

public void testEmptyExpression() throws Exception {
assertExpression("", "");
assertExpression(" ", " ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
/**
* @version
*/
public class GenerateXmFromCamelContextlTest extends ContextTestSupport {
public class GenerateXmFromCamelContextTest extends ContextTestSupport {

public void testCreateRouteFromCamelCOntext() throws Exception {
public void testCreateRouteFromCamelContext() throws Exception {
List<RouteDefinition> list = context.getRouteDefinitions();
assertEquals("Size of list " + list, 1, list.size());
RouteDefinition routeType = list.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void testDumpModelAsXml() throws Exception {
log.info(xml);

assertTrue(xml.contains("<simple>Hello ${body}</simple>"));
assertTrue(xml.contains("<to uri=\"mock:result\" customId=\"true\" id=\"myMock\"/>"));
}

@Override
Expand All @@ -40,7 +41,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
public void configure() throws Exception {
from("direct:start").routeId("myRoute")
.transform().simple("Hello ${body}")
.to("mock:result");
.to("mock:result").id("myMock");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLSocket;

import junit.framework.AssertionFailedError;

import org.apache.camel.CamelContext;

public class SSLContextParametersTest extends AbstractJsseParametersTest {
Expand All @@ -40,6 +42,12 @@ public void testFilter() {
Arrays.asList(new Pattern[0]));
assertEquals(2, result.size());
assertStartsWith(result, "TLS");
try {
assertStartsWith((String[]) null, "TLS");
fail("We chould got an exception here!");
} catch (AssertionFailedError ex) {
assertEquals("Get a wrong message", "The values should not be null", ex.getMessage());
}
}

public void testPropertyPlaceholders() throws Exception {
Expand Down Expand Up @@ -752,14 +760,16 @@ protected String[] getDefaultCipherSuiteIncludes(String[] availableCipherSuites)
}

protected void assertStartsWith(String[] values, String prefix) {
assertNotNull("The values should not be null", values);
for (String value : values) {
assertTrue(value.startsWith(prefix));
assertTrue(value + " does not start with the prefix " + prefix, value.startsWith(prefix));
}
}

protected void assertStartsWith(Collection<String> values, String prefix) {
assertNotNull("The values should not be null", values);
for (String value : values) {
assertTrue(value.startsWith(prefix));
assertTrue(value + " does not start with the prefix " + prefix, value.startsWith(prefix));
}
}
}
Loading