return start(bindPath, domain, null, null);
}
public static ResteasyDeployment start(String bindPath, SecurityDomain domain, Hashtable<String,String> initParams, Hashtable<String,String> contextParams) throws Exception
{
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.setSecurityEnabled(true);
String applicationClass = null;
if (contextParams != null)
{
applicationClass = contextParams.get("javax.ws.rs.Application");
String mediaTypeMappingsString = contextParams.get("resteasy.media.type.mappings");
if (mediaTypeMappingsString != null)
{
Map<String, String> mediaTypeMappings = new HashMap<String, String>();
String[] mappings = mediaTypeMappingsString.split(",");
for (int i = 0; i < mappings.length; i++)
{
String[] mapping = mappings[i].split(":");
mediaTypeMappings.put(mapping[0], mapping[1]);
}
deployment.setMediaTypeMappings(mediaTypeMappings);
}
}
if (applicationClass == null && initParams != null)
{
applicationClass = initParams.get("javax.ws.rs.Application");
}
if (applicationClass != null)
{
deployment.setApplicationClass(applicationClass);
}
return start(bindPath, domain, deployment, initParams, contextParams);
}