本文整理汇总了Java中org.jboss.shrinkwrap.api.asset.UrlAsset类的典型用法代码示例。如果您正苦于以下问题:Java UrlAsset类的具体用法?Java UrlAsset怎么用?Java UrlAsset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UrlAsset类属于org.jboss.shrinkwrap.api.asset包,在下文中一共展示了UrlAsset类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDeployment
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Deployment(testable = false)
public static JavaArchive createDeployment() throws Exception {
ResourceDeployer.addQueue(INPUT_QUEUE);
ResourceDeployer.addQueue(INPUT_INOUT_QUEUE);
ResourceDeployer.addQueue(INPUT_INOUT_PHYSICAL_NAME_QUEUE + "_physical", INPUT_INOUT_PHYSICAL_NAME_QUEUE + "_jndi");
ResourceDeployer.addQueue(INOUT_REPLY_TO_QUEUE);
ResourceDeployer.addQueue(INOUT_REPLY_TO_PHYSICAL_NAME_QUEUE + "_physical", INOUT_REPLY_TO_PHYSICAL_NAME_QUEUE + "_jndi");
ResourceDeployer.addQueue(INOUT_FAULT_TO_QUEUE);
ResourceDeployer.addQueue(INOUT_FAULT_TO_PHYSICAL_NAME_QUEUE + "_physical", INOUT_FAULT_TO_PHYSICAL_NAME_QUEUE + "_jndi");
ResourceDeployer.addQueue(RESULT_QUEUE);
ResourceDeployer.addQueue(FAULT_QUEUE);
URL testConfigUrl = Classes.getResource(TEST_CONFIG);
String beansXml = Descriptors.create(BeansDescriptor.class).exportAsString();
return ShrinkWrap.create(JavaArchive.class, "switchyard-JCAJMSServiceBindingTest.jar")
.addClass(JCAJMSService.class)
.addClass(JCAJMSServiceImpl.class)
.addClass(JCAJMSFault.class)
.addClass(MyJMSContextMapper.class)
.addClass(MyJMSMessageComposer.class)
.addAsManifestResource(new UrlAsset(testConfigUrl), "switchyard.xml")
.addAsManifestResource(new StringAsset(beansXml), "beans.xml");
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:24,代码来源:JCAJMSServiceBindingTest.java
示例2: managementConsoleWar
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Produces
public Archive managementConsoleWar() throws Exception {
// Load the management-ui webjars.
WARArchive war = ShrinkWrap.create(WARArchive.class, "management-console-ui.war");
Module module = Module.getBootModuleLoader().loadModule("org.jboss.as.console");
Iterator<Resource> resources = module.globResources("*");
while (resources.hasNext()) {
Resource each = resources.next();
war.add(new UrlAsset(each.getURL()), each.getName());
}
war.setContextRoot(this.fraction.contextRoot());
return war;
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:14,代码来源:ManagementConsoleDeploymentProducer.java
示例3: createDeployment
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Deployment(order = 2)
public static JavaArchive createDeployment() throws Exception {
URL testConfigUrl = Classes.getResource(TEST_CONFIG);
URL deploymentStructureUrl = Classes.getResource(DEPLOYMENT_STRUCTURE);
URL jndiProperties = Classes.getResource(JNDI_PROPERTIES);
String beansXml = Descriptors.create(BeansDescriptor.class).exportAsString();
return ShrinkWrap.create(JavaArchive.class, APP_NAME)
.addClass(JCACCIReference.class)
.addClass(JCACCIReferenceService.class)
.addClass(JCACCIReferenceServiceImpl.class)
.addAsResource(new UrlAsset(jndiProperties), "jndi.properties")
.addAsManifestResource(new UrlAsset(deploymentStructureUrl), "jboss-deployment-structure.xml")
.addAsManifestResource(new UrlAsset(testConfigUrl), "switchyard.xml")
.addAsManifestResource(new StringAsset(beansXml), "beans.xml");
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:16,代码来源:JCACCIReferenceBindingTest.java
示例4: createDeployment
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Deployment(order = 2)
public static JavaArchive createDeployment() throws Exception {
URL testConfigUrl = Classes.getResource(TEST_CONFIG);
URL deploymentStructureUrl = Classes.getResource(DEPLOYMENT_STRUCTURE);
String beansXml = Descriptors.create(BeansDescriptor.class).exportAsString();
return ShrinkWrap.create(JavaArchive.class, APP_NAME)
.addClass(JCACCIService.class)
.addClass(JCACCIServiceImpl.class)
.addAsManifestResource(new UrlAsset(deploymentStructureUrl), "jboss-deployment-structure.xml")
.addAsManifestResource(new UrlAsset(testConfigUrl), "switchyard.xml")
.addAsManifestResource(new StringAsset(beansXml), "beans.xml");
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:13,代码来源:JCACCIServiceBindingTest.java
示例5: createDeployment
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Deployment(testable = false)
public static JavaArchive createDeployment() throws Exception {
ResourceDeployer.addQueue(INPUT_TX_QUEUE);
ResourceDeployer.addQueue(INPUT_NOTX_QUEUE);
ResourceDeployer.addQueue(OUTPUT_QUEUE);
ResourceDeployer.addQueue(OUTPUT_PROP_QUEUE);
ResourceDeployer.addQueue(OUTPUT_PHYSICAL_NAME_QUEUE + "_physical", OUTPUT_PHYSICAL_NAME_QUEUE + "_jndi");
URL testConfigUrl = Classes.getResource(TEST_CONFIG);
URL camelRouteUrl = Classes.getResource(CAMEL_ROUTE);
URL jndiProperties = Classes.getResource(JNDI_PROPERTIES);
URL destJndiProperties = Classes.getResource(DEST_JNDI_PROPERTIES);
String beansXml = Descriptors.create(BeansDescriptor.class).exportAsString();
return ShrinkWrap.create(JavaArchive.class, "switchyard-JCAJMSReferenceBindingTest.jar")
.addClass(JCAJMSTransactionService.class)
.addClass(JCAJMSTransactionServiceImpl.class)
.addClass(JCAJMSReference.class)
.addClass(JCAJMSReferenceText.class)
.addClass(JCAJMSReferencePhysicalName.class)
.addClass(JCAJMSReferenceService.class)
.addClass(JCAJMSReferenceServiceImpl.class)
.addClass(JCAJMSFault.class)
.addClass(MyJMSContextMapper.class)
.addClass(MyJMSMessageComposer.class)
.addAsManifestResource(new UrlAsset(testConfigUrl), "switchyard.xml")
.addAsManifestResource(new StringAsset(beansXml), "beans.xml")
.addAsResource(new UrlAsset(jndiProperties), "jndi.properties")
.addAsResource(new UrlAsset(destJndiProperties), "destination-jndi.properties")
.addAsResource(new UrlAsset(camelRouteUrl), "camel-route.xml");
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:31,代码来源:JCAJMSReferenceBindingTest.java
示例6: createDeployment
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Deployment(order = 2)
public static JavaArchive createDeployment() throws Exception {
URL testConfigUrl = Classes.getResource(TEST_CONFIG);
URL deploymentStructureUrl = Classes.getResource(DEPLOYMENT_STRUCTURE);
String beansXml = Descriptors.create(BeansDescriptor.class).exportAsString();
return ShrinkWrap.create(JavaArchive.class, APP_NAME)
.addClass(MyStreamableRecordCCIEndpoint.class)
.addClass(JCACCIStreamReference.class)
.addClass(JCACCIStreamReferenceService.class)
.addClass(JCACCIStreamReferenceServiceImpl.class)
.addAsManifestResource(new UrlAsset(deploymentStructureUrl), "jboss-deployment-structure.xml")
.addAsManifestResource(new UrlAsset(testConfigUrl), "switchyard.xml")
.addAsManifestResource(new StringAsset(beansXml), "beans.xml");
}
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:15,代码来源:JCACCIStreamReferenceBindingTest.java
示例7: openConnection
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Override
protected URLConnection openConnection(final URL u) throws IOException {
final String arName = key(u);
final Archive<?> archive = archives.get(arName);
final String path = path(archive.getName(), WebArchive.class.isInstance(archive) ? "/WEB-INF/classes/" : "", u);
Node node = archive.get(path);
if (node == null) {
node = archive.get(path(archive.getName(), "", u)); // web resources
if (node == null) {
throw new IOException(u.toExternalForm() + " not found");
}
}
final Asset asset = node.getAsset();
if (UrlAsset.class.isInstance(asset)) {
return URL.class.cast(Reflections.get(asset, "url")).openConnection();
} else if (FileAsset.class.isInstance(asset)) {
return File.class.cast(Reflections.get(asset, "file")).toURI().toURL().openConnection();
} else if (ClassLoaderAsset.class.isInstance(asset)) {
return ClassLoader.class.cast(Reflections.get(asset, "classLoader")).getResource(String.class.cast(Reflections.get(asset, "resourceName"))).openConnection();
}
return new URLConnection(u) {
@Override
public void connect() throws IOException {
// no-op
}
@Override
public InputStream getInputStream() throws IOException {
final InputStream input = asset.openStream();
final Collection<Closeable> c = closeables.get(arName);
c.add(input);
return input;
}
};
}
开发者ID:apache,项目名称:tomee,代码行数:39,代码来源:SWClassLoader.java
示例8: addPersistenceXml
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
private static void addPersistenceXml(final Archive<?> archive, final String prefix, final AppModule appModule) {
Node persistenceXml = archive.get(prefix.concat(PERSISTENCE_XML));
if (persistenceXml == null && WEB_INF.equals(prefix)) {
persistenceXml = archive.get(WEB_INF_CLASSES.concat(META_INF).concat(PERSISTENCE_XML));
}
if (persistenceXml != null) {
final Asset asset = persistenceXml.getAsset();
if (UrlAsset.class.isInstance(asset)) {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(get(URL.class, "url", asset)));
} else if (FileAsset.class.isInstance(asset)) {
try {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(get(File.class, "file", asset).toURI().toURL()));
} catch (final MalformedURLException e) {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(new AssetSource(persistenceXml.getAsset(), null)));
}
} else if (ClassLoaderAsset.class.isInstance(asset)) {
final URL url = get(ClassLoader.class, "classLoader", asset).getResource(get(String.class, "resourceName", asset));
if (url != null) {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(url));
} else {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(new AssetSource(persistenceXml.getAsset(), null)));
}
} else {
appModule.getAltDDs().put(PERSISTENCE_XML, Arrays.asList(new AssetSource(persistenceXml.getAsset(), null)));
}
}
}
开发者ID:apache,项目名称:tomee,代码行数:28,代码来源:OpenEJBArchiveProcessor.java
示例9: addFile
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
public static void addFile(JavaArchive archive, String originalPath) {
archive.addAsResource(new UrlAsset(Thread.currentThread().getContextClassLoader().getResource("internal/" + originalPath)),
originalPath);
}
开发者ID:eclipse,项目名称:ConfigJSR,代码行数:5,代码来源:AbstractTest.java
示例10: getJolokiaAccessXmlAsset
import org.jboss.shrinkwrap.api.asset.UrlAsset; //导入依赖的package包/类
@Override
protected Asset getJolokiaAccessXmlAsset() {
return new UrlAsset(this.url);
}
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:5,代码来源:URLJolokiaAccessPreparer.java
注:本文中的org.jboss.shrinkwrap.api.asset.UrlAsset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论