Package org.jboss.wsf.spi.deployment

Examples of org.jboss.wsf.spi.deployment.UnifiedVirtualFile


      return builder;
   }

   public void processPolicyAnnotations(EndpointMetaData epMetaData, Class<?> sepClass)
   {
      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);
View Full Code Here


*/
public class PolicyMetaDataBuilderTestCase extends JBossWSTest
{
   public void testEndpointScopePolicies() throws Exception
   {
      UnifiedVirtualFile vfRoot = new URLLoaderAdapter(new File("resources/jaxws/wspolicy").toURL());
      UnifiedMetaData umd = new UnifiedMetaData(vfRoot);
     
      QName serviceName = new QName("http://org.jboss.ws/jaxws/endpoint", "TestService");
      ServiceMetaData serviceMetaData = new ServiceMetaData(umd, serviceName);
      QName portName = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointInterfacePort");
View Full Code Here

      map.put("http://www.fabrikam123.example.com/stock", NopAssertionDeployer.class);
      PolicyDeployer deployer = PolicyDeployer.newInstance(map);
      PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder(deployer);
      builder.setToolMode(true);

      UnifiedVirtualFile vfRoot = new URLLoaderAdapter(new File("resources/jaxws/wspolicy").toURL());
      UnifiedMetaData umd = new UnifiedMetaData(vfRoot);
      ServiceMetaData serviceMetaData = new ServiceMetaData(umd, new QName("dummyServiceName"));
      umd.addService(serviceMetaData);
      EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData, null, new QName("dummyPortName"), new QName("dummyPortTypeName"), Type.JAXWS);
      serviceMetaData.addEndpoint(epMetaData);
View Full Code Here

      }

      // Bind service references
      {
         ClassLoader loader = unit.getClassLoader();
         UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getRoot());
         Iterator<ServiceReferenceMetaData> serviceReferences = beanMetaData.getServiceReferences();
         if (serviceReferences != null)
         {
            while (serviceReferences.hasNext())
            {
View Full Code Here

   {
      if (unit instanceof VFSDeploymentUnit)
      {
         VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit;
         ClassLoader loader = unit.getClassLoader();
         UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(vfsUnit.getRoot());
         for (ServiceReferenceMetaData sref : serviceRefs)
         {
            String refName = sref.getServiceRefName();
            new ServiceReferenceHandler().bindServiceRef(envCtx, refName, vfsRoot, loader, sref);
         }
View Full Code Here

      if (config == null) // might be set through ServiceObjectFactory
      {
         try
         {
            WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
            UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getRootFile();
            config = wsseConfFactory.createConfiguration(vfsRoot, getConfigResourceName());
         }
         catch (IOException e)
         {
            throw new WSException("Cannot obtain security config: " + getConfigResourceName());
View Full Code Here

      EndpointMetaData epMetaData = ((CommonMessageContext)msgContext).getEndpointMetaData();
      ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();

      if(serviceMetaData.getSecurityConfiguration() == null) // might be set through ServiceObjectFactory
      {
         UnifiedVirtualFile vfsRoot = serviceMetaData.getUnifiedMetaData().getRootFile();
         WSSecurityConfiguration config = null;
         try
         {
            WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
            config = wsseConfFactory.createConfiguration(vfsRoot, getConfigResourceName());
View Full Code Here

   {
      try
      {
         Context envCtx = container.getEnc();
         ClassLoader loader = container.getClassloader();
         UnifiedVirtualFile vfsRoot = UnifiedVirtualFileFactory.getInstance().create(container.getRootFile());
         new ServiceReferenceHandler().bindServiceRef(envCtx, name, vfsRoot, loader, sref);
      }
      catch (Exception e)
      {
         throw new WebServiceException("Unable to bind ServiceRef [enc=" + name + "]", e);
View Full Code Here

   {
      try
      {
         Context envCtx = container.getEnc();
         ClassLoader loader = container.getClassloader();
         UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(container.getRootFile());
         new ServiceReferenceHandler().bindServiceRef(envCtx, name, vfsRoot, loader, sref);
      }
      catch (Exception e)
      {
         throw new WebServiceException("Unable to bind ServiceRef [enc=" + name + "]", e);
View Full Code Here

   {
      try
      {
         Context envCtx = container.getEnc();
         ClassLoader loader = container.getClassloader();
         UnifiedVirtualFile vfsRoot = UnifiedVirtualFileFactory.getInstance().create(container.getRootFile());
         new ServiceReferenceHandler().bindServiceRef(envCtx, name, vfsRoot, loader, sref);
      }
      catch (Exception e)
      {
         throw new WebServiceException("Unable to bind ServiceRef [enc=" + name + "]", e);
View Full Code Here

TOP

Related Classes of org.jboss.wsf.spi.deployment.UnifiedVirtualFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.