KIE Remote Services :: Services 6.1.0.Beta4

org.kie.remote.services.rest.jaxb
Class JaxbContextManager

java.lang.Object
  extended by org.kie.remote.services.rest.jaxb.JaxbContextManager

@ApplicationScoped
public class JaxbContextManager
extends Object


Constructor Summary
JaxbContextManager()
           
 
Method Summary
 void cleanUpOnUndeploy(org.jbpm.kie.services.impl.event.DeploymentEvent event)
          Remove the cached JAXBContext and deployment lock object It's VERY important that the cached JAXBContext instance be removed!
 void createDeploymentLockObjectOnDeploy(org.jbpm.kie.services.impl.event.DeploymentEvent event)
          Adds a deployment lock object.
 JAXBContext getJaxbContext(Class<?> type, javax.ws.rs.core.UriInfo uriInfo)
          This method does the following: Determine the deployment id from the UriInfo instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxbContextManager

public JaxbContextManager()
Method Detail

createDeploymentLockObjectOnDeploy

public void createDeploymentLockObjectOnDeploy(@Observes
                                               org.jbpm.kie.services.impl.event.DeploymentEvent event)
Adds a deployment lock object.

Parameters:
event - The DeploymentEvent fired on deployment

cleanUpOnUndeploy

public void cleanUpOnUndeploy(@Observes
                              org.jbpm.kie.services.impl.event.DeploymentEvent event)
Remove the cached JAXBContext and deployment lock object

It's VERY important that the cached JAXBContext instance be removed! The new deployment may contain a different version of a class with the same name. Keeping the old class definition will cause problems!

Parameters:
event - The DeploymentEvent fired on an undeploy of a deployment

getJaxbContext

public JAXBContext getJaxbContext(Class<?> type,
                                  javax.ws.rs.core.UriInfo uriInfo)
This method does the following:
  1. Determine the deployment id from the UriInfo instance.
  2. If the deployment id can not be determined, return a default JAXBContext instance.
  3. If a JAXBContext instance has already been created for this deployment, retrieve it from the JAXBContext cache (contextsCache) and return it.
  4. Create a JAXBContext instance based on the classes from the appropriate deployment.
  5. Cache the JAXBContext instance and return it.

Parameters:
type - The Class of the new object that should be deserialized by returned JAXBContext.
uriInfo - A UriInfo instance needed to determine the deployment containing the necessary classes.
Returns:
A JAXBContext instance

KIE Remote Services :: Services 6.1.0.Beta4

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.