本文整理了Java中com.sun.enterprise.deployment.Application.isVirtual()
方法的一些代码示例,展示了Application.isVirtual()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.isVirtual()
方法的具体详情如下:
包路径:com.sun.enterprise.deployment.Application
类名称:Application
方法名:isVirtual
[英]Returns the virtual status of this application.
[中]返回此应用程序的虚拟状态。
代码示例来源:origin: org.glassfish.deployment/dol
/**
* @return true if this module is a standalone deployment unit
*/
public boolean isStandalone() {
return application.isVirtual();
}
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* @return true if this module is a standalone deployment unit
*/
public boolean isStandalone() {
return application.isVirtual();
}
代码示例来源:origin: org.glassfish.ejb/ejb-container
/**
* return whether the bean is a "virtual" app - i.e. a stand-alone
* ejb module
*/
private boolean isVirtualApplication() {
Application application = _ejbDescriptor.getApplication();
return application.isVirtual();
}
代码示例来源:origin: org.glassfish.deployment/dol
/**
* if this application object is virtual, return the standalone
* bundle descriptor it is wrapping otherwise return null
*
* @return the wrapped standalone bundle descriptor
*/
public BundleDescriptor getStandaloneBundleDescriptor() {
if (isVirtual()) {
if (getModules().size()>1) {
// this is an error, the application is virtual,
// which mean a wrapper for a standalone module and
// it seems I have more than one module in my list...
throw new IllegalStateException("Virtual application contains more than one module");
}
return getModules().iterator().next().getDescriptor();
} else {
return null;
}
}
代码示例来源:origin: org.glassfish.deployment/dol
@Override
public boolean getKeepState() {
// for standalone module, get the keep-state value specified in
// module glassfish-*.xml
if (isVirtual()) {
BundleDescriptor bundleDesc = getStandaloneBundleDescriptor();
if (bundleDesc != null) {
return bundleDesc.getKeepState();
}
}
return super.getKeepState();
}
代码示例来源:origin: org.glassfish.main.deployment/dol
@Override
public boolean getKeepState() {
// for standalone module, get the keep-state value specified in
// module glassfish-*.xml
if (isVirtual()) {
BundleDescriptor bundleDesc = getStandaloneBundleDescriptor();
if (bundleDesc != null) {
return bundleDesc.getKeepState();
}
}
return super.getKeepState();
}
代码示例来源:origin: org.glassfish.main.persistence.cmp/cmp-support-ejb
/** Calculate module name from a bundle.
* @return module name.
*/
public static String getModuleName(EjbBundleDescriptor bundle) {
String moduleName = null;
Application application = bundle.getApplication();
if (application.isVirtual()) {
// Stand-alone module is deployed.
moduleName = application.getRegistrationName();
} else {
// Module is deployed as a part of an Application.
String jarName = bundle.getModuleDescriptor().getArchiveUri();
int l = jarName.length();
// Remove ".jar" from the bundle's jar name.
moduleName = jarName.substring(0, l - 4);
}
return moduleName;
}
代码示例来源:origin: org.glassfish.deployment/dol
public String getUniqueName() {
if(uniqueName == null) {
BundleDescriptor bundle = getEjbBundleDescriptor();
Application application = bundle.getApplication();
// Add ejb name and application name.
StringBuffer rc = new StringBuffer().
append(getName()).
append(NAME_CONCATENATOR).
append(application.getRegistrationName());
// If it's not just a module, add a module name.
if (!application.isVirtual()) {
rc.append(NAME_CONCATENATOR).
append(bundle.getModuleDescriptor().getArchiveUri());
}
uniqueName = getBaseName(getEjbClassName())
+ getUniqueNumber(rc.toString());
}
return uniqueName;
}
代码示例来源:origin: org.glassfish.main.ejb/ejb-container
public String getUniqueName() {
if(uniqueName == null) {
BundleDescriptor bundle = getEjbBundleDescriptor();
Application application = bundle.getApplication();
// Add ejb name and application name.
StringBuffer rc = new StringBuffer().
append(getName()).
append(NAME_CONCATENATOR).
append(application.getRegistrationName());
// If it's not just a module, add a module name.
if (!application.isVirtual()) {
rc.append(NAME_CONCATENATOR).
append(bundle.getModuleDescriptor().getArchiveUri());
}
uniqueName = getBaseName(getEjbClassName())
+ getUniqueNumber(rc.toString());
}
return uniqueName;
}
代码示例来源:origin: org.glassfish.web/web-glue
@SuppressWarnings("unchecked")
private Properties getActionReportProperties(DeploymentContext deployContext) {
if (!wmInfo.getDescriptor().getApplication().isVirtual()) {
deployContext = ((ExtendedDeploymentContext)deployContext).getParentContext();
}
return deployContext.getActionReport().getExtraProperties();
}
代码示例来源:origin: org.glassfish.deployment/dol
public String getModuleName() {
String moduleName = null;
// for standalone jars, return its registration name
// for applications, return the module uri
if (getApplication().isVirtual()) {
moduleName = getApplication().getRegistrationName();
} else {
moduleName = getModuleDescriptor().getArchiveUri();
}
return moduleName;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
public String getModuleName() {
String moduleName = null;
// for standalone jars, return its registration name
// for applications, return the module uri
if (getApplication().isVirtual()) {
moduleName = getApplication().getRegistrationName();
} else {
moduleName = getModuleDescriptor().getArchiveUri();
}
return moduleName;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* This method populates the rest of the Application object from the
* previous standard deployment descriptor reading
* @param archive the archive for the application
*/
public Application openWith(Application application,
ReadableArchive archive, Archivist archivist)
throws IOException, SAXException {
archivist.openWith(application, archive);
// validate
if (application.isVirtual()) {
application.setClassLoader(archivist.getClassLoader());
application.visit((ApplicationVisitor) new ApplicationValidator());
}
return application;
}
代码示例来源:origin: org.glassfish.deployment/dol
/**
* This method populates the rest of the Application object from the
* previous standard deployment descriptor reading
* @param archive the archive for the application
*/
public Application openWith(Application application,
ReadableArchive archive, Archivist archivist)
throws IOException, SAXParseException {
archivist.openWith(application, archive);
// validate
if (application.isVirtual()) {
application.setClassLoader(archivist.getClassLoader());
application.visit((ApplicationVisitor) new ApplicationValidator());
}
return application;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
public Application openWith(Application app, ReadableArchive archive)
throws IOException, SAXException {
setManifest(archive.getManifest());
// application archivist will override this method
if (app.isVirtual()) {
T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app);
if (descriptor != null) {
postOpen(descriptor, archive);
descriptor.setApplication(app);
}
}
return app;
}
代码示例来源:origin: org.glassfish.deployment/dol
public Application openWith(Application app, ReadableArchive archive)
throws IOException, SAXParseException {
setManifest(archive.getManifest());
// application archivist will override this method
if (app.isVirtual()) {
T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app);
if (descriptor != null) {
postOpen(descriptor, archive);
}
if (descriptor instanceof BundleDescriptor) {
((BundleDescriptor)descriptor).setApplication(app);
}
}
return app;
}
代码示例来源:origin: org.glassfish.main.deployment/deployment-javaee-core
public Application load(DeploymentContext dc) throws IOException {
DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class);
Application application = processDOL(dc);
// write out xml files if needed
if (Boolean.valueOf(WRITEOUT_XML)) {
saveAppDescriptor(application, dc);
}
if (application.isVirtual()) {
dc.addModuleMetaData(application.getStandaloneBundleDescriptor());
for (RootDeploymentDescriptor extension : application.getStandaloneBundleDescriptor().getExtensionsDescriptors()) {
dc.addModuleMetaData(extension);
}
}
addModuleConfig(dc, application);
validateKeepStateOption(dc, params, application);
return application;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* @return the module ID for this module descriptor
*/
public String getModuleID() {
if (moduleID == null) {
moduleID = getModuleDescriptor().getArchiveUri();
}
if (getModuleDescriptor().isStandalone()) {
return moduleID;
}
if (application != null && !application.isVirtual()) {
return application.getRegistrationName() + "#" +
getModuleDescriptor().getArchiveUri();
} else {
return moduleID;
}
}
代码示例来源:origin: org.glassfish.main.ejb/ejb-container
CallFlowInfoImpl(BaseContainer container, EjbDescriptor descriptor,
ComponentType compType) {
this.container = container;
this.ejbDescriptor = descriptor;
this.appName = (ejbDescriptor.getApplication().isVirtual()) ? null
: ejbDescriptor.getApplication().getRegistrationName();
String archiveuri = ejbDescriptor.getEjbBundleDescriptor()
.getModuleDescriptor().getArchiveUri();
this.modName = com.sun.enterprise.util.io.FileUtils
.makeFriendlyFilename(archiveuri);
this.ejbName = ejbDescriptor.getName();
this.componentType = compType;
}
代码示例来源:origin: org.glassfish.ejb/ejb-container
CallFlowInfoImpl(BaseContainer container, EjbDescriptor descriptor,
ComponentType compType) {
this.container = container;
this.ejbDescriptor = descriptor;
this.appName = (ejbDescriptor.getApplication().isVirtual()) ? null
: ejbDescriptor.getApplication().getRegistrationName();
String archiveuri = ejbDescriptor.getEjbBundleDescriptor()
.getModuleDescriptor().getArchiveUri();
this.modName = com.sun.enterprise.util.io.FileUtils
.makeFriendlyFilename(archiveuri);
this.ejbName = ejbDescriptor.getName();
this.componentType = compType;
}
内容来源于网络,如有侵权,请联系作者删除!