Commit c78bd2c4 authored by afreyssin's avatar afreyssin

Fix potential synchronization issues.

parent cfafcb19
...@@ -117,7 +117,7 @@ public class JndiService { ...@@ -117,7 +117,7 @@ public class JndiService {
@HEAD @HEAD
@Path("/{destName}") @Path("/{destName}")
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
public Response lookupDestination( public synchronized Response lookupDestination(
@Context HttpHeaders headers, @Context HttpHeaders headers,
@PathParam("destName") String destName, @PathParam("destName") String destName,
@Context UriInfo uriInfo) { @Context UriInfo uriInfo) {
...@@ -190,7 +190,7 @@ public class JndiService { ...@@ -190,7 +190,7 @@ public class JndiService {
@Path("/{destName}/"+ JmsService.JMS_CREATE_PROD) @Path("/{destName}/"+ JmsService.JMS_CREATE_PROD)
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.TEXT_PLAIN) @Consumes(MediaType.TEXT_PLAIN)
public Response createProducer( public synchronized Response createProducer(
@Context HttpHeaders headers, @Context HttpHeaders headers,
@PathParam("destName") String destName, @PathParam("destName") String destName,
@QueryParam("client-id") String clientID, @QueryParam("client-id") String clientID,
...@@ -270,7 +270,7 @@ public class JndiService { ...@@ -270,7 +270,7 @@ public class JndiService {
@POST @POST
@Path("/{destName}/"+ JmsService.JMS_CREATE_CONS) @Path("/{destName}/"+ JmsService.JMS_CREATE_CONS)
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
public Response createConsumer( public synchronized Response createConsumer(
@Context HttpHeaders headers, @Context HttpHeaders headers,
@PathParam("destName") String destName, @PathParam("destName") String destName,
@QueryParam("client-id") String clientID, @QueryParam("client-id") String clientID,
...@@ -296,7 +296,6 @@ public class JndiService { ...@@ -296,7 +296,6 @@ public class JndiService {
Response.ResponseBuilder builder = null; Response.ResponseBuilder builder = null;
try { try {
String consId = null; String consId = null;
try { try {
// lookup the destination // lookup the destination
...@@ -351,7 +350,7 @@ public class JndiService { ...@@ -351,7 +350,7 @@ public class JndiService {
@Path("/{name}") @Path("/{name}")
@Produces(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN)
@Consumes(MediaType.TEXT_PLAIN) @Consumes(MediaType.TEXT_PLAIN)
public Response closeSessionCtx( public synchronized Response closeSessionCtx(
@Context HttpHeaders headers, @Context HttpHeaders headers,
@PathParam("name") String ctxName, @PathParam("name") String ctxName,
@Context UriInfo uriInfo) { @Context UriInfo uriInfo) {
...@@ -384,11 +383,13 @@ public class JndiService { ...@@ -384,11 +383,13 @@ public class JndiService {
builder = Response.status(Response.Status.OK); builder = Response.status(Response.Status.OK);
// link jndi // link jndi
UriBuilder nextBuilder = UriBuilder.fromUri(uriInfo.getBaseUri()).path(JNDI);//TODO UriBuilder nextBuilder = UriBuilder.fromUri(uriInfo.getBaseUri()).path(JNDI);
// TODO: Adds more links?
builder.link(nextBuilder.build(), JNDI); builder.link(nextBuilder.build(), JNDI);
// link jms // link jms
nextBuilder = UriBuilder.fromUri(uriInfo.getBaseUri()).path(JmsService.JMS);//TODO nextBuilder = UriBuilder.fromUri(uriInfo.getBaseUri()).path(JmsService.JMS);
// TODO: Adds more links?
builder.link(nextBuilder.build(), JmsService.JMS); builder.link(nextBuilder.build(), JmsService.JMS);
return builder.build(); return builder.build();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment