for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
if (((String) entry.getKey()).endsWith("endpoint")) {
String endpointValue = (String) entry.getValue();
String endpointType = (String) System.getProperty((String) entry.getKey() + ".type");
if (endpointType == null) {
throw new DuccComponentInitializationException(
"Endpoint type not specified in component properties. Specify vm, queue, or topic type value for endpoint: "
+ endpointValue);
} else if (endpointType.equals("vm")) {
endpointValue = "vm:" + endpointValue;
System.setProperty((String) entry.getKey(), endpointValue);
} else if (endpointType.equals("topic") || endpointType.equals("queue")) {
endpointValue = "activemq:" + endpointType + ":" + endpointValue;
System.setProperty((String) entry.getKey(), endpointValue);
} else if (endpointType.equals("socket")) {
System.setProperty((String) entry.getKey(), "mina:tcp://localhost:");
} else {
throw new DuccComponentInitializationException("Provided Endpoint type is invalid:"
+ endpointType + ". Specify vm, queue, or topic type value for endpoint: "
+ endpointValue);
}
}
}