return builder;
}
public void processPolicyAnnotations(EndpointMetaData epMetaData, Class<?> sepClass) throws IOException
{
UnifiedVirtualFile vfRoot = epMetaData.getServiceMetaData().getUnifiedMetaData().getRootFile();
for (org.jboss.ws.extensions.policy.annotation.Policy anPolicy : sepClass.getAnnotation(PolicyAttachment.class).value())
{
InputStream is = null;
try
{
String policyFileLocation = anPolicy.policyFileLocation();
if (policyFileLocation.length() == 0)
throw new IllegalStateException("Cannot obtain @Policy.policyFileLocation");
// The root virtual file is the uniform way to obtain resources
// It should work in all containers, server/client side
UnifiedVirtualFile vfPolicyFile = vfRoot.findChild(policyFileLocation);
is = vfPolicyFile.toURL().openStream();
DOMPolicyReader reader = (DOMPolicyReader)PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
Policy unnormalizedPolicy = reader.readPolicy(is);
Policy normPolicy = (Policy)unnormalizedPolicy.normalize();
log.info("Deploying Annotated Policy = " + policyFileLocation);