Package org.jboss.wsf.common

Examples of org.jboss.wsf.common.URLLoaderAdapter


      // In case of an .war deployment the associated root file doesn't point to
      // the expanded war file structure and thus breaks service-ref usage for servlet clients.
      // This needs to be fixed in org.jboss.web.AbstractWebDeployer (JBOSS_AS/server module)
      if (vfsRoot instanceof URLLoaderAdapter)
      {
         URLLoaderAdapter ula = (URLLoaderAdapter)vfsRoot;
         URL rootURL = ula.toURL();
         if ("file".equals(rootURL.getProtocol()) && rootURL.getFile().endsWith(".war"))
         {
            String fileName = rootURL.getFile();

            if (!new File(fileName).exists()) // might be an exploded directory
            {
               // There is a filename convention for exploded directories
               fileName = fileName.substring(0, fileName.indexOf(".war")) + "-exp.war";

               File expandedDirectory = new File(fileName);
               if (!expandedDirectory.exists())
                  throw new WSFException("Failed to bind service-ref, the deployment root expandedDirectory doesn't exist: " + fileName);

               // update the rootFile
               try
               {
                  vfsRoot = new URLLoaderAdapter(expandedDirectory.toURL());
               }
               catch (MalformedURLException e)
               {
               }
            }
View Full Code Here


      // In case of an .war deployment the associated root file doesn't point to
      // the expanded war file structure and thus breaks service-ref usage for servlet clients.
      // This needs to be fixed in org.jboss.web.AbstractWebDeployer (JBOSS_AS/server module)
      if (vfsRoot instanceof URLLoaderAdapter)
      {
         URLLoaderAdapter ula = (URLLoaderAdapter)vfsRoot;
         URL rootURL = ula.toURL();
         if ("file".equals(rootURL.getProtocol()) && rootURL.getFile().endsWith(".war"))
         {
            String fileName = rootURL.getFile();

            if (!new File(fileName).exists()) // might be an exploded directory
            {
               // There is a filename convention for exploded directories
               fileName = fileName.substring(0, fileName.indexOf(".war")) + "-exp.war";

               File expandedDirectory = new File(fileName);
               if (!expandedDirectory.exists())
                  throw new WSFException("Failed to bind service-ref, the deployment root expandedDirectory doesn't exist: " + fileName);

               // update the rootFile
               try
               {
                  vfsRoot = new URLLoaderAdapter(expandedDirectory.toURL());
               }
               catch (MalformedURLException e)
               {
               }
            }
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

   {
      //Getting the SPI jar url
      ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
      URL rootURL = getJarUrl(cl.getResource("org/jboss/wsf/spi/"));
      assertNotNull(rootURL);
      URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
     
      UnifiedVirtualFile deployment = ula.findChild("org/jboss/wsf/spi/deployment/");
      assertNotNull(deployment);
      assertTrue(deployment.toURL().toExternalForm().contains("jar!")); //check we got a URL to a jar
      assertEquals("deployment/", deployment.getName());
      List<UnifiedVirtualFile> children = deployment.getChildren();
      assertNotNull(children);
View Full Code Here

   public void testWithDir() throws Exception
   {
      ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
      URL rootURL = cl.getResource("org/jboss/wsf/common/");
      assertNotNull(rootURL);
      URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
     
      UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
      assertNotNull(common);
      assertTrue(common.toURL().toExternalForm().contains("target" + File.separator + "classes")); //check we got a URL to dir
      assertEquals("common/", common.getName());
      List<UnifiedVirtualFile> children = common.getChildren();
      assertNotNull(children);
View Full Code Here

   {
      //Getting the SPI jar url
      ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
      URL rootURL = getJarUrl(cl.getResource("org/jboss/wsf/spi/"));
      assertNotNull(rootURL);
      URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
     
      UnifiedVirtualFile deployment = ula.findChild("org/jboss/wsf/spi/deployment/");
      assertNotNull(deployment);
      assertTrue(deployment.toURL().toExternalForm().contains("jar!")); //check we got a URL to a jar
      assertEquals("deployment/", deployment.getName());
      List<UnifiedVirtualFile> children = deployment.getChildren();
      assertNotNull(children);
View Full Code Here

   public void testWithDir() throws Exception
   {
      ClassLoader cl = UnifiedVirtualFile.class.getClassLoader();
      URL rootURL = cl.getResource("org/jboss/wsf/common/");
      assertNotNull(rootURL);
      URLLoaderAdapter ula = new URLLoaderAdapter(rootURL);
     
      UnifiedVirtualFile common = ula.findChild("org/jboss/wsf/common/");
      assertNotNull(common);
      assertTrue(common.toURL().toExternalForm().contains("target/classes")); //check we got a URL to dir
      assertEquals("common/", common.getName());
      List<UnifiedVirtualFile> children = common.getChildren();
      assertNotNull(children);
View Full Code Here

    */
   @Override
   public Deployment createDeployment(DeploymentInfo di)
   {
      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(null);
      dep.setType(getDeploymentType());

      Service service = dep.getService();

View Full Code Here

   @Override
   public Deployment createDeployment(DeploymentInfo di)
   {
      ArchiveDeployment dep = newDeployment(di);
      dep.setRootFile(new URLLoaderAdapter(di.localUrl));
      dep.setRuntimeClassLoader(di.ucl);
      dep.setType(getDeploymentType());

      Service service = dep.getService();
View Full Code Here

TOP

Related Classes of org.jboss.wsf.common.URLLoaderAdapter

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.