org.jboss.shrinkwrap.descriptor.api.Descriptor Java Examples

The following examples show how to use org.jboss.shrinkwrap.descriptor.api.Descriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EmbeddedJCA.java    From ironjacamar with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void undeploy(Descriptor descriptor) throws Throwable
{
   if (descriptor == null)
      throw new IllegalArgumentException("Descriptor is null");

   if (descriptor.getDescriptorName() == null)
      throw new IllegalArgumentException("Descriptor name is null");

   if (!(descriptor instanceof InputStreamDescriptor ||
         descriptor instanceof org.ironjacamar.embedded.dsl.datasources20.api.DatasourcesDescriptor ||
         descriptor instanceof org.ironjacamar.embedded.dsl.resourceadapters20.api.ResourceAdaptersDescriptor))
       throw new IllegalArgumentException("Unsupported descriptor: " + descriptor.getClass().getName());

   if (!started)
      throw new IllegalStateException("Container not started");

   File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir"));
   File descriptorFile = new File(parentDirectory, descriptor.getDescriptorName());

   log.debugf("Undeploying: %s", descriptorFile);

   kernel.getMainDeployer().undeploy(descriptorFile.toURI().toURL());

   recursiveDelete(descriptorFile);
}
 
Example #2
Source File: TargetController.java    From arquillian-container-chameleon with Apache License 2.0 5 votes vote down vote up
public void undeploy(final Descriptor descriptor) throws DeploymentException {
    deployment(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            delegate.undeploy(descriptor);
            return null;
        }
    });
}
 
Example #3
Source File: TargetController.java    From arquillian-container-chameleon with Apache License 2.0 5 votes vote down vote up
public void deploy(final Descriptor descriptor) throws DeploymentException {
    deployment(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            delegate.deploy(descriptor);
            return null;
        }
    });
}
 
Example #4
Source File: FurnaceDeploymentScenarioGenerator.java    From furnace with Eclipse Public License 1.0 5 votes vote down vote up
private void validate(Method deploymentMethod)
{
   if (!Modifier.isStatic(deploymentMethod.getModifiers()))
   {
      throw new IllegalArgumentException("Method annotated with " + Deployment.class.getName() + " is not static. "
               + deploymentMethod);
   }
   if (!Archive.class.isAssignableFrom(deploymentMethod.getReturnType())
            && !Descriptor.class.isAssignableFrom(deploymentMethod.getReturnType()))
   {
      throw new IllegalArgumentException(
               "Method annotated with " + Deployment.class.getName() +
                        " must have return type " + Archive.class.getName() + " or " + Descriptor.class.getName()
                        + ". " + deploymentMethod);
   }
   if (deploymentMethod.getParameterTypes().length != 0)
   {
      throw new IllegalArgumentException("Method annotated with " + Deployment.class.getName()
               + " can not accept parameters. " + deploymentMethod);
   }

   String name = deploymentMethod.getAnnotation(Deployment.class).name();
   try
   {
      if (!Strings.isNullOrEmpty(name) && !"_DEFAULT_".equals(name))
         AddonId.fromCoordinates(name);
   }
   catch (IllegalArgumentException e)
   {
      throw new IllegalArgumentException("@" + Deployment.class.getName()
               + " requires name in the format \"name,version\", but was \"" + name + "\". ");
   }

}
 
Example #5
Source File: TomEEContainer.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(final Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #6
Source File: ManagedSEDeployableContainer.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #7
Source File: LazyLocalTransactionMTTestCase.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Define the deployment
 * @return The deployment archive
 * @throws Exception in case of errors
 */
@Deployment(order = 2)
public static Descriptor createDescriptor() throws Exception
{
   return ResourceAdapterFactory.createLazyDeployment(TransactionSupportLevel.LocalTransaction);
}
 
Example #8
Source File: LazyLocalTransactionTestCase.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Define the deployment
 * @return The deployment archive
 * @throws Exception in case of errors
 */
@Deployment(order = 2)
public static Descriptor createDescriptor() throws Exception
{
   return ResourceAdapterFactory.createLazyDeployment(TransactionSupportLevel.LocalTransaction);
}
 
Example #9
Source File: LazyXATransactionTestCase.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Define the deployment
 * @return The deployment archive
 * @throws Exception in case of errors
 */
@Deployment(order = 2)
public static Descriptor createDescriptor() throws Exception
{
   return ResourceAdapterFactory.createLazyDeployment(TransactionSupportLevel.XATransaction);
}
 
Example #10
Source File: EmbeddedJCA.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void deploy(Descriptor descriptor) throws Throwable
{
   if (descriptor == null)
      throw new IllegalArgumentException("Descriptor is null");

   if (descriptor.getDescriptorName() == null)
      throw new IllegalArgumentException("Descriptor name is null");

   if (!(descriptor instanceof InputStreamDescriptor ||
         descriptor instanceof org.ironjacamar.embedded.dsl.datasources20.api.DatasourcesDescriptor ||
         descriptor instanceof org.ironjacamar.embedded.dsl.resourceadapters20.api.ResourceAdaptersDescriptor))
      throw new IllegalArgumentException("Unsupported descriptor: " + descriptor.getClass().getName());

   if (!started)
      throw new IllegalStateException("Container not started");

   File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir"));
   File descriptorFile = new File(parentDirectory, descriptor.getDescriptorName());

   if (descriptorFile.exists())
      recursiveDelete(descriptorFile);

   FileOutputStream os = new FileOutputStream(descriptorFile);
   BufferedOutputStream bos = new BufferedOutputStream(os, BUFFER_SIZE);
   try
   {
      descriptor.exportTo(bos);
      bos.flush();
   }
   finally
   {
      try
      {
         bos.close();
      }
      catch (IOException ignore)
      {
         // Ignore
      }
   }

   log.debugf("Deploying: %s", descriptorFile);

   kernel.getMainDeployer().deploy(descriptorFile.toURI().toURL());
}
 
Example #11
Source File: FurnaceDeployableContainer.java    From furnace with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException
{
   throw new UnsupportedOperationException("Descriptors not supported by Furnace");
}
 
Example #12
Source File: FurnaceDeployableContainer.java    From furnace with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException
{
   throw new UnsupportedOperationException("Descriptors not supported by Furnace");
}
 
Example #13
Source File: LazyCCMLocalTransactionTestCase.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Define the deployment
 * @return The deployment archive
 * @throws Exception in case of errors
 */
@Deployment(order = 2)
public static Descriptor createDescriptor() throws Exception
{
   return ResourceAdapterFactory.createLazyDeployment(TransactionSupportLevel.LocalTransaction);
}
 
Example #14
Source File: TomEEContainer.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(final Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #15
Source File: OpenEJBDeployableContainer.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(final Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #16
Source File: OpenEJBDeployableContainer.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(final Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #17
Source File: KeycloakOnUndertow.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #18
Source File: KeycloakOnUndertow.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #19
Source File: SimpleUndertowLoadBalancerContainer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #20
Source File: SimpleUndertowLoadBalancerContainer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #21
Source File: UndertowAppServer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #22
Source File: UndertowAppServer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #23
Source File: JettyAppServer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #24
Source File: JettyAppServer.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) {
    throw new UnsupportedOperationException("Not implemented");
}
 
Example #25
Source File: MeecrowaveContainer.java    From openwebbeans-meecrowave with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(final Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #26
Source File: ManagedSEDeployableContainer.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #27
Source File: QuarkusDeployableContainer.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #28
Source File: QuarkusDeployableContainer.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
    throw new UnsupportedOperationException();
}
 
Example #29
Source File: PiranhaServerLoadableExtension.java    From piranha with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void deploy(Descriptor descriptor) throws DeploymentException {
    // We don't deploy by descriptor (and neither does Arquillian it seems)
    
}
 
Example #30
Source File: PiranhaServerLoadableExtension.java    From piranha with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public void undeploy(Descriptor descriptor) throws DeploymentException {
 // We don't undeploy by descriptor (and neither does Arquillian it seems)
}