wip made remote ejb working over http
This commit is contained in:
parent
d4e537a2bf
commit
2a0d992642
393 changed files with 8916 additions and 3872 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<parent>
|
||||
<artifactId>vasc-frontend-cxf</artifactId>
|
||||
<groupId>net.forwardfire.vasc</groupId>
|
||||
<version>0.3.5-SNAPSHOT</version>
|
||||
<version>0.4.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>vasc-frontend-cxf-server</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package net.forwardfire.vasc.frontend.cxf.server;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.frontend.cxf.client.VascControllerService;
|
||||
|
||||
public class VascControllerServiceImpl implements VascControllerService {
|
||||
|
||||
private VascController vascController = null;
|
||||
|
||||
public VascControllerServiceImpl(VascController vascController) {
|
||||
this.vascController=vascController;
|
||||
}
|
||||
|
||||
public List<String> getVascEntryIds() {
|
||||
return vascController.getVascEntryController().getVascEntryIds();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,28 @@
|
|||
package net.forwardfire.vasc.frontend.cxf.server;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.frontend.cxf.client.VascEntryService;
|
||||
import net.forwardfire.vasc.frontend.cxf.data.VascEntryExecuteRequest;
|
||||
import net.forwardfire.vasc.frontend.cxf.data.VascEntryExecuteResponse;
|
||||
|
||||
public class VascEntryServiceImpl implements VascEntryService {
|
||||
|
||||
private VascController vascController = null;
|
||||
private VascEntry vascEntry = null;
|
||||
|
||||
public VascEntryServiceImpl(VascController vascController,VascEntry vascEntry) {
|
||||
this.vascController=vascController;
|
||||
this.vascEntry=vascEntry;
|
||||
}
|
||||
|
||||
public VascEntryExecuteResponse execute(VascEntryExecuteRequest request) {
|
||||
|
||||
VascEntryExecuteResponse response = new VascEntryExecuteResponse();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public String testHi(String response) {
|
||||
return "HOHO: "+response+" HAAHA..";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,10 @@ import java.util.logging.Logger;
|
|||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
import net.forwardfire.vasc.core.VascControllerProvider;
|
||||
import net.forwardfire.vasc.core.VascEntry;
|
||||
import net.forwardfire.vasc.frontend.cxf.server.VascControllerServiceImpl;
|
||||
import net.forwardfire.vasc.frontend.cxf.server.VascEntryServiceImpl;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
|
|
@ -46,7 +49,7 @@ public class VascCXFServlet extends CXFNonSpringServlet {
|
|||
|
||||
private Logger logger = Logger.getLogger(VascCXFServlet.class.getName());
|
||||
private static final long serialVersionUID = 8125039180724973858L;
|
||||
private VascControllerProvider vascControllerProvider = null;
|
||||
private VascController vascController = null;
|
||||
private boolean exportTree = false;
|
||||
|
||||
/**
|
||||
|
|
@ -70,16 +73,18 @@ public class VascCXFServlet extends CXFNonSpringServlet {
|
|||
className = className.substring(atIndex+1);
|
||||
}
|
||||
try {
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
if (cl == null) {
|
||||
cl = className.getClass().getClassLoader();
|
||||
}
|
||||
Class<?> clazz = cl.loadClass(className);
|
||||
if (classArgument==null) {
|
||||
vascControllerProvider = (VascControllerProvider)clazz.newInstance();
|
||||
} else {
|
||||
vascControllerProvider = (VascControllerProvider)clazz.getConstructor(String.class).newInstance(classArgument);
|
||||
}
|
||||
ClassLoader cl = Thread.currentThread().getContextClassLoader();
|
||||
if (cl == null) {
|
||||
cl = className.getClass().getClassLoader();
|
||||
}
|
||||
Class<?> clazz = cl.loadClass(className);
|
||||
VascControllerProvider vascControllerProvider = null;
|
||||
if (classArgument==null) {
|
||||
vascControllerProvider = (VascControllerProvider)clazz.newInstance();
|
||||
} else {
|
||||
vascControllerProvider = (VascControllerProvider)clazz.getConstructor(String.class).newInstance(classArgument);
|
||||
}
|
||||
vascController = vascControllerProvider.getVascController();
|
||||
} catch (Exception e) {
|
||||
throw new ServletException("Could not create VascControllerProvider: "+e.getMessage(),e);
|
||||
}
|
||||
|
|
@ -88,12 +93,18 @@ public class VascCXFServlet extends CXFNonSpringServlet {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void loadBus(ServletConfig servletConfig) {
|
||||
super.loadBus(servletConfig);
|
||||
Bus bus = getBus();
|
||||
BusFactory.setDefaultBus(bus);
|
||||
|
||||
|
||||
Endpoint.publish("/foobar", new VascEntryServiceImpl());
|
||||
}
|
||||
public void loadBus(ServletConfig servletConfig) {
|
||||
super.loadBus(servletConfig);
|
||||
Bus bus = getBus();
|
||||
BusFactory.setDefaultBus(bus);
|
||||
Endpoint.publish("/vascControllerService", new VascControllerServiceImpl(vascController));
|
||||
for (String id:vascController.getVascEntryController().getVascEntryIds()) {
|
||||
VascEntry ve = vascController.getVascEntryController().getVascEntryById(id);
|
||||
try {
|
||||
Endpoint.publish("/"+id, new VascEntryServiceImpl(vascController,ve));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue