private void closeEMFs(ApplicationInfo appInfo) { //Suppress warning required as there is no way to pass equivalent of List<EMF>.class to the method @SuppressWarnings("unchecked") List<EntityManagerFactory> emfsCreatedForThisApp = appInfo.getTransientAppMetaData(EMF_KEY, List.class); if(emfsCreatedForThisApp != null) { // Events are always dispatched to all registered listeners. emfsCreatedForThisApp will be null for an app that does not have PUs. for (EntityManagerFactory entityManagerFactory : emfsCreatedForThisApp) { entityManagerFactory.close(); } // We no longer have the emfs in open state clear the list. // On app enable(after a disable), for a cluster, the deployment framework calls prepare() for instances but not for DAS. // So on DAS, at a disable, the emfs will be closed and we will not attempt to close emfs when appserver goes down even if the app is re-enabled. emfsCreatedForThisApp.clear(); } }
private boolean getBooleanStateFromApplicationInfo(String flag, String appName) { ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo == null) { // appInfo can be null when running EjbDeployer.clean after a failed deploy return false; } Boolean rc = appInfo.getTransientAppMetaData(flag, Boolean.class); return (rc == null ? false : rc); }
private void doBootstrapShutdown(ApplicationInfo appInfo){ WeldBootstrap bootstrap = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP, WeldBootstrap.class); String bootstrapShutdown = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP_SHUTDOWN, String.class); if (bootstrapShutdown == null || Boolean.valueOf(bootstrapShutdown).equals(Boolean.FALSE)) { bootstrap.shutdown(); appInfo.addTransientAppMetaData(WELD_BOOTSTRAP_SHUTDOWN, "true"); } } private String getDeploymentErrorMsgPrefix( Throwable t ) {
private boolean getBooleanStateFromApplicationInfo(String flag, String appName) { ApplicationInfo appInfo = appRegistry.get(appName); if (appInfo == null) { // appInfo can be null when running EjbDeployer.clean after a failed deploy return false; } Boolean rc = appInfo.getTransientAppMetaData(flag, Boolean.class); return (rc == null ? false : rc); }
appInfo.getTransientAppMetaData(com.sun.enterprise.config.serverbeans.Application.APPLICATION, com.sun.enterprise.config.serverbeans.Application.class); Resources resources = null; if(app != null){ resources = appInfo.getTransientAppMetaData(app.getName()+"-resources", Resources.class);
appInfo.getTransientAppMetaData(com.sun.enterprise.config.serverbeans.Application.APPLICATION, com.sun.enterprise.config.serverbeans.Application.class); Resources resources = null; resources = appInfo.getTransientAppMetaData(module.getName()+"-resources", Resources.class);
List<EntityManagerFactory> emfsCreatedForThisApp = appInfo.getTransientAppMetaData(EMF_KEY, List.class ); if(emfsCreatedForThisApp == null) {
if ( event.is(org.glassfish.internal.deployment.Deployment.APPLICATION_LOADED) ) { ApplicationInfo appInfo = (ApplicationInfo)event.hook(); WeldBootstrap bootstrap = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP, WeldBootstrap.class); if( bootstrap != null ) { DeploymentImpl deploymentImpl = appInfo.getTransientAppMetaData( WELD_DEPLOYMENT, DeploymentImpl.class); String shutdown = appInfo.getTransientAppMetaData(WELD_SHUTDOWN, String.class); if (Boolean.valueOf(shutdown).equals(Boolean.TRUE)) { return; Thread.currentThread().setContextClassLoader(appInfo.getAppClassLoader()); try { WeldBootstrap bootstrap = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP, WeldBootstrap.class); if (bootstrap != null) { final String fAppName = appInfo.getName(); Thread.currentThread().setContextClassLoader(currentContextClassLoader); DeploymentImpl deploymentImpl = appInfo.getTransientAppMetaData( WELD_DEPLOYMENT, DeploymentImpl.class); if (deploymentImpl != null) { deploymentImpl.cleanup();