本文整理了Java中org.jvnet.hk2.config.Transaction.<init>()
方法的一些代码示例,展示了Transaction.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.<init>()
方法的具体详情如下:
包路径:org.jvnet.hk2.config.Transaction
类名称:Transaction
方法名:<init>
暂无
代码示例来源:origin: javaee/glassfish
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()) {
代码示例来源:origin: org.glassfish.main.security/security
final protected Transaction transaction() {
if (t == null) {
t = new Transaction();
}
return t;
}
代码示例来源:origin: org.glassfish.main.common/amx-core
public Applyer(final ConfigBean cb) throws TransactionFailure
{
this(cb, new Transaction());
}
代码示例来源:origin: javaee/glassfish
Transaction t = new Transaction();
for (WriteableView view : views) {
if (!view.join(t)) {
代码示例来源:origin: org.glassfish.main.core/kernel
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();
}
代码示例来源:origin: fujitsu/launcher
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();
}
代码示例来源:origin: org.glassfish.main.loadbalancer/gf-load-balancer-connector
private static boolean setInternalProperty(LbConfig lc,
String propertyName) {
Property property = lc.getProperty(propertyName);
Transaction transaction = new Transaction();
try {
if (property == null) {
代码示例来源:origin: eclipse-ee4j/glassfish
private static boolean setInternalProperty(LbConfig lc,
String propertyName) {
Property property = lc.getProperty(propertyName);
Transaction transaction = new Transaction();
try {
if (property == null) {
代码示例来源:origin: fujitsu/launcher
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);
}
}
代码示例来源:origin: org.glassfish.main.core/kernel
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);
}
}
代码示例来源:origin: com.sun.enterprise/config
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()) {
代码示例来源:origin: org.glassfish.hk2/hk2-config
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()) {
代码示例来源:origin: org.glassfish.admin/config-api
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;
}
代码示例来源:origin: org.glassfish.main.admin/config-api
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;
}
代码示例来源:origin: org.glassfish.deployment/deployment-admin
Transaction t = new Transaction();
代码示例来源:origin: org.glassfish.security/security
private void ensureNonDASConfigsHaveAdminNetworkListener() throws TransactionFailure {
final Transaction t = new Transaction();
代码示例来源:origin: org.glassfish.main.core/kernel
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;
}
代码示例来源:origin: fujitsu/launcher
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;
}
代码示例来源:origin: org.glassfish.admin/config-api
final Transaction t = new Transaction();
try {
for (Application app : domain.getApplications().getApplications()) {
代码示例来源:origin: org.glassfish.main.admin/admin-core
final Transaction t = new Transaction();
try {
for (Application app : domain.getApplications().getApplications()) {
内容来源于网络,如有侵权,请联系作者删除!