本文整理汇总了Java中org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive.addAsLibrary方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceAdapterArchive.addAsLibrary方法的具体用法?Java ResourceAdapterArchive.addAsLibrary怎么用?Java ResourceAdapterArchive.addAsLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive
的用法示例。
在下文中一共展示了ResourceAdapterArchive.addAsLibrary方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: createPerfRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the perf.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createPerfRar()
{
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5");
org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter();
org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(PerfManagedConnectionFactory.class.getName())
.connectionfactoryInterface(PerfConnectionFactory.class.getName())
.connectionfactoryImplClass(PerfConnectionFactoryImpl.class.getName())
.connectionInterface(PerfConnection.class.getName())
.connectionImplClass(PerfConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "perf.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "perf.jar");
ja.addPackages(true, PerfConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例4: createTxLogRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the txlog.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createTxLogRar()
{
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5");
org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter();
org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(TxLogManagedConnectionFactory.class.getName())
.connectionfactoryInterface(TxLogConnectionFactory.class.getName())
.connectionfactoryImplClass(TxLogConnectionFactoryImpl.class.getName())
.connectionInterface(TxLogConnection.class.getName())
.connectionImplClass(TxLogConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "txlog.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "txlog.jar");
ja.addPackages(true, TxLogConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例5: createDeployment
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Define the deployment
*
* @return The deployment archive
*/
@Deployment(order = 1)
public static ResourceAdapterArchive createDeployment()
{
ResourceAdapterArchive raa =
ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class,
UUID.randomUUID().toString() + ".jar");
ja.addClasses(HelloWorldResourceAdapter.class,
HelloWorldManagedConnectionFactory.class,
HelloWorldManagedConnection.class,
HelloWorldManagedConnectionMetaData.class,
HelloWorldConnectionFactory.class,
HelloWorldConnectionFactoryImpl.class,
HelloWorldConnection.class,
HelloWorldConnectionImpl.class);
raa.addAsLibrary(ja);
// Contains the default deployment information
raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml");
return raa;
}
示例6: createDeployment
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Define the deployment
*
* @return The deployment archive
*/
@Deployment(name="ConnectorTestCase", order = 1)
public static ResourceAdapterArchive createDeployment() {
ResourceAdapterArchive raa = ShrinkWrap.create(
ResourceAdapterArchive.class, deploymentName + ".rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID()
.toString() + ".jar");
ja.addPackages(true,
Package.getPackage("org.wildfly.connector.rabbitmq"));
raa.addAsLibrary(ja);
raa.addAsManifestResource("ironjacamar-test.xml", "ironjacamar.xml");
System.out.println(raa.toString(true));
return raa;
}
示例7: createDeployment
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
@Deployment
public static ResourceAdapterArchive createDeployment() {
ResourceAdapterArchive raa = ShrinkWrap.create(
ResourceAdapterArchive.class, DEPLOYMENT_NAME + ".rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, UUID.randomUUID()
.toString() + ".jar");
ja.addClasses(VertxResourceAdapter.class,
VertxManagedConnectionFactory.class, VertxManagedConnection.class,
VertxConnectionFactory.class, VertxConnectionFactoryImpl.class,
VertxConnection.class, VertxConnectionImpl.class);
raa.addAsLibrary(ja);
raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml");
return raa;
}
示例8: createRarArchive
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
private ResourceAdapterArchive createRarArchive(String rarName) {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class,
new Random().nextInt(100000) + ".jar");
jar.addPackage(AbstractAdapter.class.getPackage());
jar.addPackage(DummyAdapter.class.getPackage());
log.info("Jar: {}", jar.toString(true));
ResourceAdapterArchive rar = ShrinkWrap.create(
ResourceAdapterArchive.class, rarName);
rar.addAsLibrary(jar);
log.info("Rar: {}", rar.toString(true));
return rar;
}
示例9: createLazyRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the lazy.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createLazyRar()
{
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector15.ConnectorDescriptor.class, "ra.xml").version("1.5");
org.jboss.shrinkwrap.descriptor.api.connector15.ResourceadapterType rt = raXml.getOrCreateResourceadapter()
.resourceadapterClass(LazyResourceAdapter.class.getName());
rt.createConfigProperty().configPropertyName("Enable")
.configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.TRUE.toString());
rt.createConfigProperty().configPropertyName("LocalTransaction")
.configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.FALSE.toString());
rt.createConfigProperty().configPropertyName("XATransaction")
.configPropertyType(Boolean.class.getName()).configPropertyValue(Boolean.FALSE.toString());
org.jboss.shrinkwrap.descriptor.api.connector15.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector15.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(LazyManagedConnectionFactory.class.getName())
.connectionfactoryInterface(LazyConnectionFactory.class.getName())
.connectionfactoryImplClass(LazyConnectionFactoryImpl.class.getName())
.connectionInterface(LazyConnection.class.getName())
.connectionImplClass(LazyConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "lazy.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "lazy.jar");
ja.addPackages(true, LazyConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例10: createWorkRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the work.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createWorkRar()
{
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6");
org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter()
.resourceadapterClass(WorkResourceAdapter.class.getName());
org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(WorkManagedConnectionFactory.class.getName())
.connectionfactoryInterface(WorkConnectionFactory.class.getName())
.connectionfactoryImplClass(WorkConnectionFactoryImpl.class.getName())
.connectionInterface(WorkConnection.class.getName())
.connectionImplClass(WorkConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "work.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "work.jar");
ja.addPackages(true, WorkConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例11: createWorkRarMCFNoHashCode
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the work.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createWorkRarMCFNoHashCode()
{
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6");
org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter()
.resourceadapterClass(WorkResourceAdapter.class.getName());
org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(WorkManagedConnectionFactoryNoHashCode.class.getName())
.connectionfactoryInterface(WorkConnectionFactory.class.getName())
.connectionfactoryImplClass(WorkConnectionFactoryImpl.class.getName())
.connectionInterface(WorkConnection.class.getName())
.connectionImplClass(WorkConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "work.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "work.jar");
ja.addPackages(true, WorkConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例12: createUnifiedSecurityRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the unified-security.rar
*
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createUnifiedSecurityRar()
{
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6");
org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter()
.resourceadapterClass(UnifiedSecurityResourceAdapter.class.getName());
org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("XATransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(UnifiedSecurityManagedConnectionFactory.class.getName())
.connectionfactoryInterface(UnifiedSecurityConnectionFactory.class.getName())
.connectionfactoryImplClass(UnifiedSecurityConnectionFactoryImpl.class.getName())
.connectionInterface(UnifiedSecurityConnection.class.getName())
.connectionImplClass(UnifiedSecurityConnectionImpl.class.getName());
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "unified-security.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "unified-security.jar");
ja.addPackages(true, UnifiedSecurityConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}
示例13: createDeployment
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Define the deployment
*
* @return The deployment archive
*/
@Deployment(order = 1)
public static ResourceAdapterArchive createDeployment()
{
String deploymentName = "ConnectorTestCase.rar";
ResourceAdapterArchive raa =
ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName);
JavaArchive ja = ShrinkWrap.create(JavaArchive.class,
UUID.randomUUID().toString() + ".jar");
ja.addClasses(HelloWorldResourceAdapter.class,
HelloWorldManagedConnectionFactory.class,
HelloWorldManagedConnection.class,
HelloWorldManagedConnectionMetaData.class,
HelloWorldConnectionFactory.class,
HelloWorldConnectionFactoryImpl.class,
HelloWorldConnection.class,
HelloWorldConnectionImpl.class);
raa.addAsLibrary(ja);
// Contains the deployment information
raa.addAsManifestResource("META-INF/ironjacamar.xml", "ironjacamar.xml");
String rootPath =
System.getProperty("test.dir") + File.separator + ".." + File.separator;
File root = new File(rootPath);
for (File f : root.listFiles())
{
if (f.getName().contains("HelloWorld"))
raa.addAsLibrary(f);
}
return raa;
}
示例14: createTestRar
import org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive; //导入方法依赖的package包/类
/**
* Create the test.rar
*
* @return The resource adapter archive
*/
public static ResourceAdapterArchive createTestRar()
{
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor raXml = Descriptors
.create(org.jboss.shrinkwrap.descriptor.api.connector16.ConnectorDescriptor.class, "ra.xml").version("1.6");
org.jboss.shrinkwrap.descriptor.api.connector16.ResourceadapterType rt = raXml.getOrCreateResourceadapter()
.resourceadapterClass(TestResourceAdapter.class.getName());
org.jboss.shrinkwrap.descriptor.api.connector16.OutboundResourceadapterType ort = rt
.getOrCreateOutboundResourceadapter().transactionSupport("NoTransaction").reauthenticationSupport(false);
org.jboss.shrinkwrap.descriptor.api.connector16.ConnectionDefinitionType cdt = ort.createConnectionDefinition()
.managedconnectionfactoryClass(TestManagedConnectionFactory.class.getName())
.connectionfactoryInterface(TestConnectionFactory.class.getName())
.connectionfactoryImplClass(TestConnectionFactoryImpl.class.getName())
.connectionInterface(TestConnection.class.getName())
.connectionImplClass(TestConnectionImpl.class.getName());
cdt.createConfigProperty().configPropertyName("CreateFailureCount")
.configPropertyType(Integer.class.getName()).configPropertyValue("0");
cdt.createConfigProperty().configPropertyName("InvalidConnectionFailureCount")
.configPropertyType(Integer.class.getName()).configPropertyValue("0");
rt.createAdminobject().adminobjectInterface(TestAdminObject.class.getName())
.adminobjectClass(TestAdminObjectImpl.class.getName());
rt.getOrCreateInboundResourceadapter().getOrCreateMessageadapter().getOrCreateMessagelistener()
.messagelistenerType(TestMessageListener.class.getName())
.getOrCreateActivationspec().activationspecClass(TestActivationSpec.class.getName())
.getOrCreateRequiredConfigProperty().configPropertyName("Name");
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "test.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "test.jar");
ja.addPackages(true, PerfConnection.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(new StringAsset(raXml.exportAsString()), "ra.xml");
return raa;
}