本文整理汇总了Java中org.jboss.shrinkwrap.descriptor.api.Descriptors.create方法的典型用法代码示例。如果您正苦于以下问题:Java Descriptors.create方法的具体用法?Java Descriptors.create怎么用?Java Descriptors.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.shrinkwrap.descriptor.api.Descriptors
的用法示例。
在下文中一共展示了Descriptors.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createWorkDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
/**
* Create the work.rar deployment
*
* @param bc The BootstrapContext name; <code>null</code> if default
* @return The resource adapter descriptor
*/
public static ResourceAdaptersDescriptor createWorkDeployment(String bc)
{
ResourceAdaptersDescriptor dashRaXml = Descriptors.create(ResourceAdaptersDescriptor.class, "work-ra.xml");
ResourceAdapterType dashRaXmlRt = dashRaXml.createResourceAdapter().archive("work.rar");
if (bc != null)
dashRaXmlRt.bootstrapContext(bc);
ConnectionDefinitionsType dashRaXmlCdst = dashRaXmlRt.getOrCreateConnectionDefinitions();
org.ironjacamar.embedded.dsl.resourceadapters20.api.ConnectionDefinitionType dashRaXmlCdt = dashRaXmlCdst
.createConnectionDefinition().className(WorkManagedConnectionFactory.class.getName())
.jndiName("java:/eis/WorkConnectionFactory").id("WorkConnectionFactory");
org.ironjacamar.embedded.dsl.resourceadapters20.api.PoolType dashRaXmlPt = dashRaXmlCdt.getOrCreatePool()
.minPoolSize(0).initialPoolSize(0).maxPoolSize(10);
return dashRaXml;
}
示例2: createWorkDeploymentMCFNoHashCode
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
/**
* Create the work.rar deployment
*
* @param bc The BootstrapContext name; <code>null</code> if default
* @return The resource adapter descriptor
*/
public static ResourceAdaptersDescriptor createWorkDeploymentMCFNoHashCode(String bc)
{
ResourceAdaptersDescriptor dashRaXml = Descriptors.create(ResourceAdaptersDescriptor.class, "work-ra.xml");
ResourceAdapterType dashRaXmlRt = dashRaXml.createResourceAdapter().archive("work.rar");
if (bc != null)
dashRaXmlRt.bootstrapContext(bc);
ConnectionDefinitionsType dashRaXmlCdst = dashRaXmlRt.getOrCreateConnectionDefinitions();
org.ironjacamar.embedded.dsl.resourceadapters20.api.ConnectionDefinitionType dashRaXmlCdt = dashRaXmlCdst
.createConnectionDefinition().className(WorkManagedConnectionFactoryNoHashCode.class.getName())
.jndiName("java:/eis/WorkConnectionFactory").id("WorkConnectionFactory");
org.ironjacamar.embedded.dsl.resourceadapters20.api.PoolType dashRaXmlPt = dashRaXmlCdt.getOrCreatePool()
.minPoolSize(0).initialPoolSize(0).maxPoolSize(10);
return dashRaXml;
}
示例3: war
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment
public static WebArchive war()
{
String simpleName = EnableInterceptorsTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
// CDI 1.0/Weld 1.x needs EnableInterceptorsInterceptor
BeansDescriptor beansWithEnablingInterceptor = Descriptors.create(BeansDescriptor.class);
beansWithEnablingInterceptor.getOrCreateInterceptors().clazz(EnableInterceptorsInterceptor.class.getName());
// war archive needs MyBeanInterceptor enabled
BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
beans.getOrCreateInterceptors().clazz(MyBeanInterceptor.class.getName());
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar")
.addPackage(EnableInterceptorsTest.class.getPackage())
.addAsManifestResource(new StringAsset(beansWithEnablingInterceptor.exportAsString()), "beans.xml");
return ShrinkWrap.create(WebArchive.class, archiveName + ".war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndProxyArchive())
.addAsLibraries(testJar)
.addAsWebInfResource(new StringAsset(beans.exportAsString()), "beans.xml");
}
示例4: testShrinkWrapDescriptorsLookup
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Test
public void testShrinkWrapDescriptorsLookup()
{
DockerDescriptor descriptor = Descriptors.create(DockerDescriptor.class);
Assert.assertNotNull(descriptor);
assertThat(descriptor, instanceOf(DockerDescriptorImpl.class));
}
示例5: testInstructions
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Test
public void testInstructions()
{
DockerDescriptor descriptor = Descriptors.create(DockerDescriptor.class);
Assert.assertEquals("FROM jbossforge", descriptor.from().name("jbossforge").toString());
Assert.assertEquals("USER George", descriptor.user().name("George").toString());
assertThat(descriptor.getInstructions().size(), equalTo(2));
String output = descriptor.exportAsString();
Assert.assertEquals("FROM jbossforge\nUSER George", output);
}
示例6: testSimpleInstructions
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Test
public void testSimpleInstructions()
{
DockerDescriptor descriptor = Descriptors.create(DockerDescriptor.class);
descriptor.from("jbossforge").maintainer("George Gastaldi").user("GEORGE");
assertThat(descriptor.getInstructions().size(), equalTo(3));
String output = descriptor.exportAsString();
Assert.assertEquals("FROM jbossforge\nMAINTAINER George Gastaldi\nUSER GEORGE", output);
}
示例7: testOnBuild
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Test
public void testOnBuild() throws Exception
{
DockerDescriptor descriptor = Descriptors.create(DockerDescriptor.class);
descriptor.onBuild().instruction(RunInstruction.class).parameters("cd", "foo");
Assert.assertEquals("ONBUILD RUN [\"cd\",\"foo\"]", descriptor.exportAsString());
}
示例8: createDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment(testable = false)
public static WebArchive createDeployment() {
final WebAppDescriptor webAppDescriptor = Descriptors.create(WebAppDescriptor.class);
webAppDescriptor.version("3.0");
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "connector-sample-war.war");
webArchive.addPackage("org.superbiz.connector.api");
webArchive.addPackage("org.superbiz.connector.adapter");
webArchive.addPackage("org.superbiz.application");
webArchive.addAsWebInfResource(ConnectorWithApplicationResourcesInEarTest.class.getResource("/connector/resources.xml"), "resources.xml");
webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
System.out.println("Webapp:\n" + webArchive.toString(true));
return webArchive;
}
示例9: deploy
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment
public static WebArchive deploy()
{
// create beans.xml with added interceptor
BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
beans.getOrCreateInterceptors().clazz(FutureableInterceptor.class.getName());
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "FutureableTest.jar")
.addPackage(Service.class.getPackage().getName())
.addAsManifestResource(new StringAsset(beans.exportAsString()), "beans.xml");
return ShrinkWrap.create(WebArchive.class, "FutureableTest.war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
.addAsLibraries(testJar)
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
示例10: deploy
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment
public static WebArchive deploy()
{
// create beans.xml with added interceptor
BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
beans.getOrCreateInterceptors().clazz(LockedInterceptor.class.getName());
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "LockedTest.jar")
.addPackage(Service.class.getPackage().getName())
.addAsManifestResource(new StringAsset(beans.exportAsString()), "beans.xml");
return ShrinkWrap.create(WebArchive.class, "LockedTest.war")
.addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive())
.addAsLibraries(testJar)
.addAsWebInfResource(new StringAsset(beans.exportAsString()), "beans.xml");
}
示例11: testNestedOnBuildIsInvalid
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testNestedOnBuildIsInvalid() throws Exception
{
DockerDescriptor descriptor = Descriptors.create(DockerDescriptor.class);
descriptor.onBuild().instruction(OnBuildInstruction.class);
}
示例12: createTestDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
/**
* Create the test.rar deployment
*
* @param allocationRetry The number of allocation retries
* @param validation True is foreground, false is background, null is none
* @param invalidConnectionFailureCount The invalid connection failure count
* @param connectionDefID the id of ConnectionDefinition
* @param adminObjectID the id of AdminObject
* @param bc the BootstrapContext
* @return The resource adapter descriptor
*/
public static ResourceAdaptersDescriptor createTestDeployment(int allocationRetry, Boolean validation,
int invalidConnectionFailureCount, String connectionDefID, String adminObjectID, String bc)
{
ResourceAdaptersDescriptor dashRaXml = Descriptors.create(ResourceAdaptersDescriptor.class, "test-ra.xml");
ResourceAdapterType dashRaXmlRt = dashRaXml.createResourceAdapter().archive("test.rar");
if (bc != null)
dashRaXmlRt.bootstrapContext(bc);
ConnectionDefinitionsType dashRaXmlCdst = dashRaXmlRt.getOrCreateConnectionDefinitions();
org.ironjacamar.embedded.dsl.resourceadapters20.api.ConnectionDefinitionType dashRaXmlCdt = dashRaXmlCdst
.createConnectionDefinition().className(TestManagedConnectionFactory.class.getName())
.jndiName("java:/eis/" + connectionDefID).id(connectionDefID);
if (allocationRetry > 0)
{
dashRaXmlCdt.createConfigProperty().name("CreateFailureCount")
.text(Integer.toString(allocationRetry));
dashRaXmlCdt.getOrCreateTimeout().allocationRetry(Integer.valueOf(allocationRetry))
.allocationRetryWaitMillis(100);
}
if (validation != null)
{
dashRaXmlCdt.createConfigProperty().name("InvalidConnectionFailureCount")
.text(Integer.toString(invalidConnectionFailureCount));
org.ironjacamar.embedded.dsl.resourceadapters20.api.ValidationType dashRaXmlVt =
dashRaXmlCdt.getOrCreateValidation();
if (validation)
{
dashRaXmlVt.validateOnMatch(Boolean.TRUE);
}
else
{
dashRaXmlVt.backgroundValidation(Boolean.TRUE).backgroundValidationMillis(0);
}
}
dashRaXmlRt.getOrCreateAdminObjects().createAdminObject().className(TestAdminObjectImpl.class.getName())
.jndiName("java:/eis/" + adminObjectID);
return dashRaXml;
}
示例13: createDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment(testable = false)
public static EnterpriseArchive createDeployment() {
final JavaArchive apiJar = ShrinkWrap.create(JavaArchive.class, "api.jar");
apiJar.addPackages(true, "org.tomitribe.connector.starter.api");
System.out.println(apiJar.toString(true));
System.out.println();
final JavaArchive rarLib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
rarLib.addPackages(false,
"org.tomitribe.connector.starter.adapter",
"org.tomitribe.connector.starter.authenticator");
System.out.println(rarLib.toString(true));
System.out.println();
final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "test.rar");
rar.addAsLibraries(rarLib);
final ConnectorDescriptor raXml = Descriptors.create(ConnectorDescriptor.class);
rar.setResourceAdapterXML(new StringAsset(raXml.exportAsString()));
System.out.println(rar.toString(true));
System.out.println();
final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
final WebAppDescriptor webXml = Descriptors.create(WebAppDescriptor.class);
webXml.description("Test webapp");
war.addPackages(true, "org.superbiz");
war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
war.setWebXML(new StringAsset(webXml.exportAsString()));
System.out.println(war.toString(true));
System.out.println();
// Make the EAR
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
.addAsModule(rar).addAsModule(war).addAsLibraries(apiJar);
final ApplicationDescriptor applicationDescriptor = Descriptors.create(ApplicationDescriptor.class);
applicationDescriptor.libraryDirectory("lib");
applicationDescriptor.createModule().getOrCreateWeb().contextRoot("test").webUri("test.war");
applicationDescriptor.getOrCreateModule().connector("test.rar");
System.out.println(applicationDescriptor.exportAsString());
ear.setApplicationXML(new StringAsset(applicationDescriptor.exportAsString()));
System.out.println(ear.toString(true));
System.out.println();
return ear;
}
示例14: createDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
@Deployment
public static EnterpriseArchive createDeployment() {
final JavaArchive apiJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-api.jar");
apiJar.addPackage("org.superbiz.connector.api");
System.out.println("API JAR:\n" + apiJar.toString(true));
final JavaArchive implJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-impl.jar");
implJar.addPackage("org.superbiz.connector.adapter");
System.out.println("IMPL JAR:\n" + implJar.toString(true));
final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class,"connector-sample-ra.rar");
rar.addAsLibraries(implJar);
final File raXml = Basedir.basedir("../connector-sample-rar/src/main/rar/META-INF/ra.xml");
rar.setResourceAdapterXML(raXml);
System.out.println("RAR:\n" + rar.toString(true));
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "connector-sample-war.war");
webArchive.addPackage("org.superbiz.application");
final WebAppDescriptor webAppDescriptor = Descriptors.create(WebAppDescriptor.class);
webAppDescriptor.version("3.0");
final File resourcesXml = Basedir.basedir("../connector-sample-war/src/main/webapp/WEB-INF/resources.xml");
webArchive.addAsWebInfResource(resourcesXml);
webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
webArchive.addAsWebInfResource(resourcesXml);
webArchive.addAsWebInfResource(new StringAsset("<beans/>"), "beans.xml");
System.out.println("Webapp:\n" + webArchive.toString(true));
final EnterpriseArchive enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "connector-sample.ear");
enterpriseArchive.addAsLibraries(apiJar);
enterpriseArchive.addAsModule(rar);
enterpriseArchive.addAsModule(webArchive);
ApplicationDescriptor applicationXml = Descriptors.create(ApplicationDescriptor.class);
applicationXml.displayName("connector-sample-ear");
applicationXml.createModule()
.getOrCreateWeb()
.webUri("connector-sample-war.war")
.contextRoot("/sample")
.up().up()
.createModule().connector("connector-sample-ra.rar")
.up().libraryDirectory("lib");
enterpriseArchive.setApplicationXML(new StringAsset(applicationXml.exportAsString()));
System.out.println(enterpriseArchive.toString(true));
return enterpriseArchive;
}
示例15: createDeployment
import org.jboss.shrinkwrap.descriptor.api.Descriptors; //导入方法依赖的package包/类
public static EnterpriseArchive createDeployment() {
final JavaArchive apiJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-api.jar");
apiJar.addPackage("org.superbiz.connector.api");
System.out.println("API JAR:\n" + apiJar.toString(true));
final JavaArchive implJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-impl.jar");
implJar.addPackage("org.superbiz.connector.adapter");
System.out.println("IMPL JAR:\n" + implJar.toString(true));
final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class,"connector-sample-ra.rar");
rar.addAsLibraries(implJar);
final File raXml = Basedir.basedir("../connector-sample-rar/src/main/rar/META-INF/ra.xml");
rar.setResourceAdapterXML(raXml);
System.out.println("RAR:\n" + rar.toString(true));
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "connector-sample-war.war");
webArchive.addPackage("org.superbiz.application");
final WebAppDescriptor webAppDescriptor = Descriptors.create(WebAppDescriptor.class);
webAppDescriptor.version("3.0");
final File resourcesXml = Basedir.basedir("../connector-sample-war/src/main/webapp/WEB-INF/resources.xml");
webArchive.addAsWebInfResource(resourcesXml);
webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
webArchive.addAsWebInfResource(resourcesXml);
webArchive.addAsWebInfResource(new StringAsset("<beans/>"), "beans.xml");
System.out.println("Webapp:\n" + webArchive.toString(true));
final EnterpriseArchive enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "connector-sample.ear");
enterpriseArchive.addAsLibraries(apiJar);
enterpriseArchive.addAsModule(rar);
enterpriseArchive.addAsModule(webArchive);
ApplicationDescriptor applicationXml = Descriptors.create(ApplicationDescriptor.class);
applicationXml.displayName("connector-sample-ear");
applicationXml.createModule()
.getOrCreateWeb()
.webUri("connector-sample-war.war")
.contextRoot("/sample")
.up().up()
.createModule().connector("connector-sample-ra.rar")
.up().libraryDirectory("lib");
enterpriseArchive.setApplicationXML(new StringAsset(applicationXml.exportAsString()));
System.out.println(enterpriseArchive.toString(true));
return enterpriseArchive;
}