Skip to content
Snippets Groups Projects
Commit 45a825b6 authored by Constantin Jucovschi's avatar Constantin Jucovschi
Browse files

adding MMT and updates to docmanager

parent b82e9cc5
No related branches found
No related tags found
No related merge requests found
Showing
with 632 additions and 61 deletions
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
package info.kwarc.sally.comm.core;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "heartbeatrequest")
public class Heartbeatrequest {
}
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
package info.kwarc.sally.comm.core;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "heartbeatresponse")
public class Heartbeatresponse {
}
......@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.10 at 09:55:55 AM CEST
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
......@@ -60,4 +60,20 @@ public class ObjectFactory {
return new Onsallyframe();
}
/**
* Create an instance of {@link Heartbeatrequest }
*
*/
public Heartbeatrequest createHeartbeatrequest() {
return new Heartbeatrequest();
}
/**
* Create an instance of {@link Heartbeatresponse }
*
*/
public Heartbeatresponse createHeartbeatresponse() {
return new Heartbeatresponse();
}
}
......@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.10 at 09:55:55 AM CEST
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
......
......@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.10 at 09:55:55 AM CEST
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
......
......@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.10 at 09:55:55 AM CEST
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
......
......@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.04.10 at 09:55:55 AM CEST
// Generated on: 2014.04.13 at 10:53:19 PM CEST
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://kwarc.info/sally/comm/core", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
......
package info.kwarc.sally4.core;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
public interface CamelContextProvider {
CamelContext getSallyCamelContext();
Component getComponent(String componentName);
void registerGlobalComponent(String componentName, Component component);
void unregisterGlobalComponent(String componentName);
String getName();
}
......@@ -25,6 +25,7 @@ public class Activator implements BundleActivator, CamelContextProvider {
}
public void start(BundleContext context) throws Exception {
log.info("Starting SallyCore");
ServiceReference<?> serviceRef = context.getServiceReference(CamelContext.class.getName());
if (serviceRef == null) {
camelContext = new DefaultCamelContext();
......@@ -41,4 +42,21 @@ public class Activator implements BundleActivator, CamelContextProvider {
return camelContext;
}
public org.apache.camel.Component getComponent(String componentName) {
return camelContext.getComponent(componentName);
}
public void registerGlobalComponent(String componentName,
org.apache.camel.Component component) {
camelContext.addComponent(componentName, component);
}
public void unregisterGlobalComponent(String componentName) {
camelContext.removeComponent(componentName);
}
public String getName() {
return camelContext.getName();
}
}
......@@ -31,5 +31,15 @@
</xs:complexType>
</xs:element>
<xs:element name="heartbeatrequest">
<xs:complexType>
</xs:complexType>
</xs:element>
<xs:element name="heartbeatresponse">
<xs:complexType>
</xs:complexType>
</xs:element>
</xs:schema>
\ No newline at end of file
......@@ -30,6 +30,18 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.kwarc.sally4</groupId>
<artifactId>activemq</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>info.kwarc.sally4</groupId>
<artifactId>docmanager</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.ipojo.annotations</artifactId>
......@@ -48,6 +60,11 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
<build>
......@@ -60,8 +77,9 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Private-Package>info.kwarc.sally4.docmanager</Private-Package>
<Export-Package></Export-Package>
<Private-Package>info.kwarc.sally4.docmanager.impl</Private-Package>
<Import-Package>*;</Import-Package>
<Export-Package>info.kwarc.sally4.docmanager*</Export-Package>
</instructions>
</configuration>
</plugin>
......
package info.kwarc.sally4.docmanager;
public interface AlexRoute {
public String getAlexStateQueue();
public String getAlexQueue();
public void addOnStopHandler(Runnable r);
public void stop();
}
......@@ -3,5 +3,5 @@ package info.kwarc.sally4.docmanager;
import info.kwarc.sally.comm.core.Registerdocument;
public interface DocumentManager {
void registerDocument(Registerdocument doc);
AlexRoute registerDocument(Registerdocument doc);
}
package info.kwarc.sally4.docmanager;
import info.kwarc.sally.comm.core.Registerdocument;
import info.kwarc.sally4.docmanager.component.AlexComponent;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.camel.component.ActiveMQComponent;
import org.apache.activemq.camel.component.ActiveMQConfiguration;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class TT extends RouteBuilder {
String sally_queue;
public String getSally_queue() {
return "activemq:queue:"+sally_queue;
}
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
connectionFactory.setUserName("webclient");
connectionFactory.setPassword("webclient");
ActiveMQConfiguration config = new ActiveMQConfiguration();
config.setConnectionFactory(connectionFactory);
ActiveMQComponent comp = new ActiveMQComponent(config);
context.addComponent("activemq", comp);
context.addComponent("alex", new AlexComponent(new AlexRoute() {
public String getAlexStateQueue() {
return "sally_alex";
}
public String getAlexQueue() {
return "alex";
}
public void addOnStopHandler(Runnable r) {
}
public void stop() {
}
}));
context.addRoutes(new TT());
context.start();
ProducerTemplate temp = context.createProducerTemplate();
System.out.println("starting my stuff");
Registerdocument reg = new Registerdocument();
reg.setDocumentqueue("client123");
reg.setTheoqueue("theo");
reg.getInterfaces().add("test");
temp.sendBody("direct:client-register", reg);
}
@Override
public void configure() throws Exception {
from("direct:client-register")
.to("alex:default");
}
}
package info.kwarc.sally4.docmanager;
import info.kwarc.sally.comm.CommUtils;
import info.kwarc.sally.comm.core.Onsallyframe;
import info.kwarc.sally.comm.core.Registerdocument;
import info.kwarc.sally.comm.core.Registerdocumentresponse;
import info.kwarc.sally4.docmanager.routes.SallyRegisterRoute;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.camel.component.ActiveMQComponent;
import org.apache.activemq.camel.component.ActiveMQConfiguration;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.DataFormat;
public class TestMain extends RouteBuilder {
String sally_queue;
public String getSally_queue() {
return "activemq:queue:"+sally_queue;
}
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
connectionFactory.setUserName("webclient");
connectionFactory.setPassword("webclient");
ActiveMQConfiguration config = new ActiveMQConfiguration();
config.setConnectionFactory(connectionFactory);
ActiveMQComponent comp = new ActiveMQComponent(config);
context.addComponent("activemq", comp);
context.addRoutes(new TestMain());
context.start();
ProducerTemplate temp = context.createProducerTemplate();
System.out.println("starting my stuff");
Registerdocument reg = new Registerdocument();
reg.setDocumentqueue("client123");
reg.setTheoqueue("theo");
reg.getInterfaces().add("test");
temp.sendBody("direct:client-register", reg);
}
@Override
public void configure() throws Exception {
DataFormat core = CommUtils.getDataFormat("core");
from("direct:client-register")
.marshal(core)
.inOut("activemq:queue:"+SallyRegisterRoute.sallyRegisterQueue)
.to("log:msg")
.unmarshal(core)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Registerdocumentresponse resp = exchange.getIn().getBody(Registerdocumentresponse.class);
sally_queue = resp.getSallyqueue();
}
})
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
ProducerTemplate temp = exchange.getContext().createProducerTemplate();
Onsallyframe onSallyFrame = new Onsallyframe();
onSallyFrame.setPosx(100);
onSallyFrame.setPosy(100);
temp.sendBody("direct:send_sally_doc", onSallyFrame);
}
});
from("direct:send_sally_doc").marshal(core).inOut("activemq:queue:sally_doc_client123").to("log:asd");
from("activemq:queue:client123")
.to("log:test")
.unmarshal(core)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println(exchange.getIn().getBody());
}
});
}
}
package info.kwarc.sally4.docmanager.component;
import info.kwarc.sally4.docmanager.AlexRoute;
import java.util.Map;
import org.apache.activemq.camel.component.ActiveMQComponent;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
import org.apache.camel.Consumer;
import org.apache.camel.Endpoint;
import org.apache.camel.EndpointConfiguration;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
import org.apache.camel.PollingConsumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.impl.DefaultComponent;
/**
*
* @author Constantin Jucovschi
*
* This component allows to write Camel routes like from("alex") or to("alex")
* and these will be resolved to the necessary
*/
public class AlexComponent extends DefaultComponent {
AlexRoute route;
DefaultComponent tt;
CamelContext camelContext;
Endpoint alexProducer;
Endpoint alexConsumer;
public AlexComponent(AlexRoute route) {
super();
this.route = route;
}
@Override
protected Endpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
ActiveMQComponent activeMQComponent = (ActiveMQComponent) getCamelContext().getComponent("activemq");
alexConsumer = activeMQComponent.createEndpoint("activemq:queue:"+route.getAlexStateQueue());
alexProducer = activeMQComponent.createEndpoint("activemq:queue:"+route.getAlexQueue());
return new AlexComponentEndpoint(uri, this);
}
class AlexComponentEndpoint implements Endpoint {
String endPoint;
Component comp;
CamelContext context;
AlexComponentEndpoint(String endPoint, Component comp) {
this.endPoint = endPoint;
this.comp = comp;
this.context = comp.getCamelContext();
}
public boolean isSingleton() {
return false;
}
public void start() throws Exception {
alexConsumer.start();
alexProducer.start();
}
public void stop() throws Exception {
alexConsumer.stop();
alexProducer.stop();
}
public String getEndpointUri() {
return endPoint;
}
public EndpointConfiguration getEndpointConfiguration() {
return null;
}
public String getEndpointKey() {
return "alex";
}
public Exchange createExchange() {
return alexConsumer.createExchange();
}
public Exchange createExchange(ExchangePattern pattern) {
return alexConsumer.createExchange(pattern);
}
@Deprecated
public Exchange createExchange(Exchange exchange) {
return alexConsumer.createExchange(exchange);
}
public CamelContext getCamelContext() {
return comp.getCamelContext();
}
public Producer createProducer() throws Exception {
return alexProducer.createProducer();
}
public Consumer createConsumer(Processor processor) throws Exception {
return alexConsumer.createConsumer(processor);
}
public PollingConsumer createPollingConsumer() throws Exception {
return alexConsumer.createPollingConsumer();
}
public void configureProperties(Map<String, Object> options) {
}
public void setCamelContext(CamelContext context) {
this.context = context;
}
public boolean isLenientProperties() {
return false;
}
}
}
......@@ -2,8 +2,10 @@ package info.kwarc.sally4.docmanager.impl;
import info.kwarc.sally4.docmanager.AlexRoute;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
public class AlexRouteImpl implements AlexRoute {
......@@ -11,10 +13,10 @@ public class AlexRouteImpl implements AlexRoute {
String alexQueue;
String theoQueue;
HashSet<String> interfaces;
String alexStateRoute;
List<Runnable> stopHandlers;
String alexStateQueue;
String generateUUID(String doc_queue) {
//"/queue/sally_doc_"+UUID.randomUUID().toString()
return "sally_doc_"+doc_queue;
......@@ -23,12 +25,30 @@ public class AlexRouteImpl implements AlexRoute {
public AlexRouteImpl(String alexQueue, String theoQueue, Collection<String> interfaces) {
this.alexQueue = alexQueue;
this.theoQueue = theoQueue;
this.interfaces = new HashSet<String>(this.interfaces);
this.alexStateRoute = generateUUID(alexQueue);
this.interfaces = new HashSet<String>(interfaces);
this.alexStateQueue = generateUUID(alexQueue);
stopHandlers = new ArrayList<Runnable>();
}
public String getAlexStateRoute() {
return alexStateRoute;
public String getAlexStateQueue() {
return alexStateQueue;
}
public String getAlexQueue() {
return alexQueue;
}
public void addOnStopHandler(Runnable stopHandler) {
stopHandlers.add(stopHandler);
}
public void stop() {
for (Runnable r : stopHandlers) {
try {
r.run();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
package info.kwarc.sally4.docmanager.impl;
import info.kwarc.sally.comm.core.Registerdocument;
import info.kwarc.sally4.activemq.ActiveMQService;
import info.kwarc.sally4.core.CamelContextProvider;
import info.kwarc.sally4.docmanager.AlexRoute;
import info.kwarc.sally4.docmanager.DocumentManager;
import info.kwarc.sally4.docmanager.routes.SallyRegisterRoute;
import java.util.HashMap;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Invalidate;
import org.apache.felix.ipojo.annotations.Provides;
import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Validate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Component
@Instantiate
@Provides
public class DocumentManagerImpl implements DocumentManager {
Map<String, Registerdocument> docs;
Map<String, String> sallyDocQueue;
Map<String, AlexRoute> docs;
SallyRegisterRoute registerRoute;
CamelContext camelContext;
Logger log;
@Requires
ActiveMQService activeMQ;
@Requires
CamelContextProvider camelContextProvider;
public DocumentManagerImpl() {
docs = new HashMap<String, Registerdocument>();
sallyDocQueue = new HashMap<String, String>();
docs = new HashMap<String, AlexRoute>();
registerRoute = new SallyRegisterRoute(this);
log = LoggerFactory.getLogger(getClass());
}
String generateUUID(String doc_queue) {
//"/queue/sally_doc_"+UUID.randomUUID().toString()
return "sally_doc_"+doc_queue;
public AlexRoute registerDocument(Registerdocument doc) {
if (docs.containsKey(doc.getDocumentqueue()))
return docs.get(doc.getDocumentqueue());
AlexRouteImpl route = new AlexRouteImpl(doc.getDocumentqueue(), doc.getTheoqueue(), doc.getInterfaces());
docs.put(doc.getDocumentqueue(), route);
return route;
}
public void registerDocument(Registerdocument doc) {
docs.put(doc.getDocumentqueue(), doc);
if (sallyDocQueue.containsKey(doc.getDocumentqueue()))
return;
String sally_doc_queue = generateUUID(doc.getDocumentqueue());
sallyDocQueue.put(doc.getDocumentqueue(), sally_doc_queue);
/*
@Validate
public void start() {
try {
context.addRoutes(sallyDocRouteFactory.create(networkProvider, doc.getDocumentqueue(), sally_doc_queue, doc.getTheoqueue()));
log.info(camelContextProvider.getName());
camelContext = new DefaultCamelContext();
camelContext.addComponent("activemq", camelContextProvider.getComponent("activemq"));
camelContext.addRoutes(registerRoute);
camelContext.start();
} catch (Exception e) {
log.info(e.getMessage());
e.printStackTrace();
}
*/
}
public final Map<String, Registerdocument> getDocs() {
return docs;
}
public String getSallyDocumentQueue(String docQueue) {
return sallyDocQueue.get(docQueue);
@Invalidate
public void stop() {
try {
camelContext.stop();
for (AlexRoute route : docs.values()) {
route.stop();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
package info.kwarc.sally4.docmanager.routes;
import info.kwarc.sally.comm.CommUtils;
import info.kwarc.sally.comm.core.Heartbeatrequest;
import info.kwarc.sally4.docmanager.AlexRoute;
import org.apache.camel.ExchangeTimedOutException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spi.DataFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SallyAlexRoute extends RouteBuilder {
Logger log;
AlexRoute route;
public Heartbeatrequest generateHeartbeat() {
return new Heartbeatrequest();
}
public void stopSallyRoute() {
route.stop();
}
SallyAlexRoute(AlexRoute route) {
log = LoggerFactory.getLogger(getClass());
this.route = route;
}
@Override
public void configure() throws Exception {
DataFormat core = CommUtils.getDataFormat("core");
from("timer://foo?fixedRate=true&period=60000")
.bean(method(this, "generateHeartbeat"))
.marshal(core)
.doTry()
.inOut("alex:default")
.doCatch(ExchangeTimedOutException.class)
.bean(method(this, "stopSallyRoute"));
from("alex:default")
.to("log:test")
.to("alex:default");
}
}
package info.kwarc.sally4.docmanager.impl;
package info.kwarc.sally4.docmanager.routes;
import info.kwarc.sally.comm.CommUtils;
import info.kwarc.sally.comm.core.Registerdocumentresponse;
import info.kwarc.sally4.docmanager.AlexRoute;
import info.kwarc.sally4.docmanager.component.AlexComponent;
import info.kwarc.sally4.docmanager.impl.DocumentManagerImpl;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.DataFormat;
public class DocumentManagerRoutes extends RouteBuilder {
public class SallyRegisterRoute extends RouteBuilder {
public static final String sallyRegisterQueue = "sally_register";
public static final String directSallyRegisterQueue = "direct:/queue/sally_register";
public static final String mockSallyRegisterQueueOutput = "mock:/queue/sally_register_out";
/*
RegisterProcessor registerProcessor;
public SallyRegisterRoute(RegisterProcessor registerProcessor) {
this.registerProcessor = registerProcessor;
DocumentManagerImpl docManager;
public SallyRegisterRoute(DocumentManagerImpl docManager) {
this.docManager = docManager;
}
*/
public Registerdocumentresponse createRouteContext(AlexRoute route) throws Exception {
final CamelContext alexRouteContext = new DefaultCamelContext();
alexRouteContext.addComponent("activemq", getContext().getComponent("activemq"));
alexRouteContext.addComponent("alex", new AlexComponent(route));
alexRouteContext.addRoutes(new SallyAlexRoute(route));
alexRouteContext.getShutdownStrategy().setTimeout(1);
alexRouteContext.start();
route.addOnStopHandler(new Runnable() {
public void run() {
try {
alexRouteContext.stop();
} catch (Exception e) {
e.printStackTrace();
}
}
});
Registerdocumentresponse response = new Registerdocumentresponse();
response.setSallyqueue(route.getAlexStateQueue());
return response;
}
@Override
public void configure() throws Exception {
DataFormat core = CommUtils.getDataFormat("core");
from("activemq:queue:"+sallyRegisterQueue)
.unmarshal(core)
.inOut(directSallyRegisterQueue)
.marshal(core);
from("sallyservlet:///test")
.to("log:test")
.to("freemarker:templates/theo.html");
from(directSallyRegisterQueue)
.to(mockSallyRegisterQueueOutput);
.unmarshal(core)
.bean(docManager, "registerDocument")
.bean(method(this, "createRouteContext"))
.marshal(core);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment