当前位置: 首页>>代码示例>>Java>>正文


Java ResourceAdapterArchive.addAsLibraries方法代码示例

本文整理汇总了Java中org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive.addAsLibraries方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceAdapterArchive.addAsLibraries方法的具体用法?Java ResourceAdapterArchive.addAsLibraries怎么用?Java ResourceAdapterArchive.addAsLibraries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive的用法示例。


在下文中一共展示了ResourceAdapterArchive.addAsLibraries方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConnector

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
 * Define the deployment
 *
 * @return The deployment archive
 */
@Deployment(name= "RAR", testable = false, order = 1)
public static ResourceAdapterArchive createConnector() {
	ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + "_RAR.rar");

	JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + "_RARimpl.jar");
	// Just the code packages (not the testing ones)
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.Constants.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.cci.EisConnection.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.driver.EisConnectionWorker.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.spi.ResourceAdapterCustom.class.getPackage());
	raa.addAsLibrary(ja);

	JavaArchive jaEis = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + "_EISimpl.jar");
	jaEis.addPackages(false, org.darrylmiles.example.eis.EisImpl.class.getPackage());
	raa.addAsLibraries(jaEis);

	raa.addAsManifestResource(new File("../ee7-jca-eis-rar/src/main/rar/META-INF/ironjacamar.xml"), "ironjacamar.xml");
	raa.addAsManifestResource(new File("../ee7-jca-eis-rar/src/main/rar/META-INF/jboss-deployment-structure.xml"), "jboss-deployment-structure.xml");
	//File file = new File("src/main/rar/META-INF/ironjacamar.xml");
	//assertTrue(file.isFile());
	//raa.addAsManifestResource(file, file.getName());		// "ironjacamar.xml"

	return raa;
}
 
开发者ID:dlmiles,项目名称:full-example-ee7-jca-eis,代码行数:30,代码来源:TestRarAlongsideEar.java

示例2: createConnector

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
 * Define the deployment
 *
 * @return The deployment archive
 */
public static ResourceAdapterArchive createConnector() {
	ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + "_RAR.rar");

	JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + "_RARimpl.jar");
	// Just the code packages (not the testing ones)
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.Constants.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.cci.EisConnection.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.driver.EisConnectionWorker.class.getPackage());
	ja.addPackages(false, org.darrylmiles.example.ee7.jca.eis.rar.spi.ResourceAdapterCustom.class.getPackage());
	raa.addAsLibrary(ja);

	JavaArchive jaEis = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID().toString() + "_EISimpl.jar");
	jaEis.addPackages(false, org.darrylmiles.example.eis.EisImpl.class.getPackage());
	raa.addAsLibraries(jaEis);

	raa.addAsManifestResource(new File("../ee7-jca-eis-rar/src/main/rar/META-INF/ironjacamar.xml"), "ironjacamar.xml");
	raa.addAsManifestResource(new File("../ee7-jca-eis-rar/src/main/rar/META-INF/jboss-deployment-structure.xml"), "jboss-deployment-structure.xml");
	//File file = new File("src/main/rar/META-INF/ironjacamar.xml");
	//assertTrue(file.isFile());
	//raa.addAsManifestResource(file, file.getName());		// "ironjacamar.xml"

	return raa;
}
 
开发者ID:dlmiles,项目名称:full-example-ee7-jca-eis,代码行数:29,代码来源:TestEjbClientInsideEar.java

示例3: createDeployment

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的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;
}
 
开发者ID:apache,项目名称:tomee,代码行数:52,代码来源:Runner.java

示例4: createDeployment

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的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;
}
 
开发者ID:apache,项目名称:tomee,代码行数:52,代码来源:EARTest.java

示例5: createDeployment

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的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;
    }
 
开发者ID:apache,项目名称:tomee,代码行数:51,代码来源:DeployInWebAppsDirectoryTest.java

示例6: createDeployment

import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的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);

    rar.setResourceAdapterXML(ConnectorWithApplicationResourcesInEarTest.class.getResource("/connector/ra.xml"));
    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");

    webArchive.addAsWebInfResource(ConnectorWithApplicationResourcesInEarTest.class.getResource("/connector/resources.xml"), "resources.xml");
    webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
    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;
}
 
开发者ID:apache,项目名称:tomee,代码行数:48,代码来源:ConnectorWithApplicationResourcesInEarTest.java


注:本文中的org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive.addAsLibraries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。