public void apply(Map<ConfigBean, Map<String, String>> mapOfChanges) throws TransactionFailure { Transaction t = new Transaction(); try { for (Map.Entry<ConfigBean, Map<String, String>> configBeanChange : mapOfChanges.entrySet()) {
final protected Transaction transaction() { if (t == null) { t = new Transaction(); } return t; }
public Applyer(final ConfigBean cb) throws TransactionFailure { this(cb, new Transaction()); }
Transaction t = new Transaction(); for (WriteableView view : views) { if (!view.join(t)) {
public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
public void unregisterTenantWithAppInDomainXML( final String appName, final String tenantName ) throws TransactionFailure, RetryableException { final com.sun.enterprise.config.serverbeans.Application app = applications.getApplication(appName); if (app == null) { throw new IllegalArgumentException("Application " + appName + " not found"); } final AppTenants appTenants = app.getAppTenants(); final AppTenant appTenant = appTenants.getAppTenant(tenantName); if (appTenant == null) { throw new IllegalArgumentException("Tenant " + tenantName + " not provisioned for application " + appName); } Transaction t = new Transaction(); final AppTenants appTenants_w = t.enroll(appTenants); appTenants_w.getAppTenant().remove(appTenant); t.commit(); }
private static boolean setInternalProperty(LbConfig lc, String propertyName) { Property property = lc.getProperty(propertyName); Transaction transaction = new Transaction(); try { if (property == null) {
private static boolean setInternalProperty(LbConfig lc, String propertyName) { Property property = lc.getProperty(propertyName); Transaction transaction = new Transaction(); try { if (property == null) {
public void registerTenantWithAppInDomainXML( final String appName, final ExtendedDeploymentContext context) throws TransactionFailure { final Transaction t = new Transaction(); try { final AppTenant appTenant_w = writeableTenantForApp( appName, t); appTenant_w.setContextRoot(context.getAppProps().getProperty(ServerTags.CONTEXT_ROOT)); appTenant_w.setTenant(context.getTenant()); t.commit(); } catch (TransactionFailure ex) { t.rollback(); throw ex; } catch (Throwable ex) { t.rollback(); throw new TransactionFailure(ex.getLocalizedMessage(), ex); } }
public void registerTenantWithAppInDomainXML( final String appName, final ExtendedDeploymentContext context) throws TransactionFailure { final Transaction t = new Transaction(); try { final AppTenant appTenant_w = writeableTenantForApp( appName, t); appTenant_w.setContextRoot(context.getAppProps().getProperty(ServerTags.CONTEXT_ROOT)); appTenant_w.setTenant(context.getTenant()); t.commit(); } catch (TransactionFailure ex) { t.rollback(); throw ex; } catch (Throwable ex) { t.rollback(); throw new TransactionFailure(ex.getLocalizedMessage(), ex); } }
public void apply(Map<ConfigBean, Map<String, String>> mapOfChanges) throws TransactionFailure { Transaction t = new Transaction(); try { for (Map.Entry<ConfigBean, Map<String, String>> configBeanChange : mapOfChanges.entrySet()) {
public void apply(Map<ConfigBean, Map<String, String>> mapOfChanges) throws TransactionFailure { Transaction t = new Transaction(); try { for (Map.Entry<ConfigBean, Map<String, String>> configBeanChange : mapOfChanges.entrySet()) {
public static List<SecureAdminPrincipal> secureAdminPrincipals( final SecureAdmin secureAdmin, final Habitat habitat) { List<SecureAdminPrincipal> result = Collections.EMPTY_LIST; if (secureAdmin != null) { result = secureAdmin.getSecureAdminPrincipal(); if (result.isEmpty()) { try{ final Transaction t = new Transaction(); final SecureAdmin secureAdmin_w = t.enroll(secureAdmin); result = secureAdmin_w.getSecureAdminPrincipal(); final SecureAdminPrincipal dasPrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); dasPrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.dasAlias(), true)); result.add(dasPrincipal); final SecureAdminPrincipal instancePrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); instancePrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.instanceAlias(), true)); result.add(instancePrincipal); t.commit(); } catch (Exception ex) { throw new RuntimeException(ex); } } } return result; }
public static List<SecureAdminPrincipal> secureAdminPrincipals( final SecureAdmin secureAdmin, final ServiceLocator habitat) { List<SecureAdminPrincipal> result = Collections.EMPTY_LIST; if (secureAdmin != null) { result = secureAdmin.getSecureAdminPrincipal(); if (result.isEmpty()) { try{ final Transaction t = new Transaction(); final SecureAdmin secureAdmin_w = t.enroll(secureAdmin); result = secureAdmin_w.getSecureAdminPrincipal(); final SecureAdminPrincipal dasPrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); dasPrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.dasAlias(), true)); result.add(dasPrincipal); final SecureAdminPrincipal instancePrincipal = secureAdmin_w.createChild(SecureAdminPrincipal.class); instancePrincipal.setDn(secureAdminHelper(habitat).getDN(secureAdmin.instanceAlias(), true)); result.add(instancePrincipal); t.commit(); } catch (Exception ex) { throw new RuntimeException(ex); } } } return result; }
Transaction t = new Transaction();
private void ensureNonDASConfigsHaveAdminNetworkListener() throws TransactionFailure { final Transaction t = new Transaction();
public Transaction prepareAppConfigChanges(final DeploymentContext context) throws TransactionFailure { final Properties appProps = context.getAppProps(); final DeployCommandParameters deployParams = context.getCommandParameters(DeployCommandParameters.class); Transaction t = new Transaction(); try { // prepare the application element ConfigBean newBean = ((ConfigBean)ConfigBean.unwrap(applications)).allocate(Application.class); Application app = newBean.createProxy(); Application app_w = t.enroll(app); setInitialAppAttributes(app_w, deployParams, appProps, context); context.addTransientAppMetaData(ServerTags.APPLICATION, app_w); } catch(TransactionFailure e) { t.rollback(); throw e; } catch (Exception e) { t.rollback(); throw new TransactionFailure(e.getMessage(), e); } return t; }
public Transaction prepareAppConfigChanges(final DeploymentContext context) throws TransactionFailure { final Properties appProps = context.getAppProps(); final DeployCommandParameters deployParams = context.getCommandParameters(DeployCommandParameters.class); Transaction t = new Transaction(); try { // prepare the application element ConfigBean newBean = ((ConfigBean)ConfigBean.unwrap(applications)).allocate(Application.class); Application app = newBean.createProxy(); Application app_w = t.enroll(app); setInitialAppAttributes(app_w, deployParams, appProps, context); context.addTransientAppMetaData(ServerTags.APPLICATION, app_w); } catch(TransactionFailure e) { t.rollback(); throw e; } catch (Exception e) { t.rollback(); throw new TransactionFailure(e.getMessage(), e); } return t; }
final Transaction t = new Transaction(); try { for (Application app : domain.getApplications().getApplications()) {
final Transaction t = new Transaction(); try { for (Application app : domain.getApplications().getApplications()) {