Skip to content

Commit

Permalink
Minor tweaks and logging on Jersey resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Riou committed May 26, 2009
1 parent b51aeab commit 84ed8b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/intalio/simplex/http/EngineWebResource.java
Expand Up @@ -33,6 +33,7 @@
import javax.ws.rs.core.UriInfo;

import org.apache.ode.bpel.iapi.Resource;
import org.apache.log4j.Logger;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.ContextHandler;
import org.mortbay.jetty.handler.HandlerList;
Expand All @@ -51,6 +52,8 @@
@Path("/")
public class EngineWebResource {

private static final Logger __log = Logger.getLogger(EngineWebResource.class);

private static Server _server;
private static ServerLifecycle _serverLifecyle;

Expand Down Expand Up @@ -90,6 +93,8 @@ private static String stripSlashes(String sl) {
}

public static void registerResource(Resource resource) {
if (__log.isDebugEnabled())
__log.debug("Registering resource " + resource.getUrl() + " / " + resource.getMethod());
String nonSlashed = stripSlashes(resource.getUrl());
ResourceDesc desc = _engineResources.get(new UriTemplate(nonSlashed));
if (desc == null) {
Expand Down
Expand Up @@ -139,25 +139,25 @@ public Response getSub() {
@POST
@Consumes("application/xml") @Produces("application/xml")
public Response post(String content) {
Element msgElmt = null;
try {
Element msgElmt = null;
if (content.length() > 0) msgElmt = DOMUtils.stringToDOM(content);
return post(msgElmt, FEJOML.XML);
} catch (Exception e) {
return Response.status(400).entity("Couldn't parse XML request.").type("text/plain").build();
}
return post(msgElmt, FEJOML.XML);
}

@POST @Path("{sub : .*}")
@Consumes("application/xml") @Produces("application/xml")
public Response postSub(String content) {
Element msgElmt = null;
try {
Element msgElmt = null;
if (content.length() > 0) msgElmt = DOMUtils.stringToDOM(content);
return post(msgElmt, FEJOML.XML);
} catch (Exception e) {
return Response.status(400).entity("Couldn't parse XML request.").type("text/plain").build();
}
return post(msgElmt, FEJOML.XML);
}

@POST
Expand Down

0 comments on commit 84ed8b6

Please sign in to comment.