本文整理汇总了Java中javax.ejb.TransactionAttributeType.NOT_SUPPORTED属性的典型用法代码示例。如果您正苦于以下问题:Java TransactionAttributeType.NOT_SUPPORTED属性的具体用法?Java TransactionAttributeType.NOT_SUPPORTED怎么用?Java TransactionAttributeType.NOT_SUPPORTED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.ejb.TransactionAttributeType
的用法示例。
在下文中一共展示了TransactionAttributeType.NOT_SUPPORTED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStopFlag
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setStopFlag(Long taskId, Boolean stopFlag) {
Connection connection = null;
try {
connection = ds.getConnection();
new PostgreSqlBuilder().update(connection, Query
.UPDATE(TABLE.JMD_TASK())
.SET(JMD_TASK.STOP_FLAG(), stopFlag)
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
}
示例2: setLastUpdate
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setLastUpdate(Long taskId) {
Connection connection = null;
try {
connection = ds.getConnection();
Column currentTimestamp = new ColumnFunction("id", "current_timestamp", DataType.DATE);
new PostgreSqlBuilder().update(connection, Query
.UPDATE(TABLE.JMD_TASK())
.SET(JMD_TASK.LAST_UPDATE(), currentTimestamp)
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
}
示例3: getStatus
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public TaskStatus getStatus(Long taskId) {
TaskStatus result = null;
Connection connection = null;
try {
connection = ds.getConnection();
List<Object[]> rows = new PostgreSqlBuilder().select(connection, Query
.SELECT(JMD_TASK.STATUS()).FROM(TABLE.JMD_TASK())
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
if (!rows.isEmpty()) {
result = TaskStatus.valueOf((String) rows.get(0)[0]);
}
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
return result;
}
示例4: setKillFlag
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setKillFlag(Long taskId, Boolean killFlag) {
Connection connection = null;
try {
connection = ds.getConnection();
new PostgreSqlBuilder().update(connection, Query
.UPDATE(TABLE.JMD_TASK())
.SET(JMD_TASK.KILL_FLAG(), killFlag)
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
}
示例5: setStopFlag
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setStopFlag(Long taskId, Boolean stopFlag) {
Connection connection = null;
try {
connection = ds.getConnection();
new H2SqlBuilder().update(connection, Query
.UPDATE(TABLE.JMD_TASK())
.SET(JMD_TASK.STOP_FLAG(), stopFlag)
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
}
示例6: getDataList
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<JmdTaskData> getDataList(Long taskId) {
Connection connection = null;
List<JmdTaskData> result = new ArrayList<>();
try {
connection = ds.getConnection();
result = getDataList(connection, taskId);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "RESULT:{0}", result);
}
return result;
}
示例7: modifyInstance
/**
* Starts the modification of an application instance.
* <p>
* The internal status <code>MODIFICATION_REQUESTED</code> is stored as a
* controller configuration setting. It is evaluated and handled by the
* status dispatcher, which is invoked at regular intervals by APP through
* the <code>getInstanceStatus</code> method.
*
* @param instanceId
* the ID of the application instance to be modified
* @param currentSettings
* a <code>ProvisioningSettings</code> object specifying the
* current service parameters and configuration settings
* @param newSettings
* a <code>ProvisioningSettings</code> object specifying the
* modified service parameters and configuration settings
* @return an <code>InstanceStatus</code> instance with the overall status
* of the application instance
* @throws APPlatformException
*/
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public InstanceStatus modifyInstance(String instanceId,
ProvisioningSettings currentSettings,
ProvisioningSettings newSettings) throws APPlatformException {
LOGGER.info("modifyInstance({})", LogAndExceptionConverter
.getLogText(instanceId, currentSettings));
try {
PropertyHandler ph = PropertyHandler.withSettings(newSettings);
ph.setOperation(Operation.EC2_MODIFICATION);
ph.setState(FlowState.MODIFICATION_REQUESTED);
InstanceStatus result = new InstanceStatus();
result.setChangedParameters(newSettings.getParameters());
result.setChangedAttributes(newSettings.getAttributes());
return result;
} catch (Throwable t) {
throw LogAndExceptionConverter.createAndLogPlatformException(t,
Context.MODIFICATION);
}
}
示例8: deleteTask
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void deleteTask(Long taskId) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "{0}", taskId);
}
JmdTask task = taskDao.getTask(taskId);
if (task != null) {
switch (TaskStatus.valueOf(task.getStatus())) {
case INTERRUPTED:
case STOPPED:
case FINISHED:
case FAILED:
case KILLED:
taskDao.deleteTask(taskId);
break;
}
}
}
示例9: createInstance
/**
* Starts the creation of an application instance and returns the instance
* ID.
* <p>
* The internal status <code>CREATION_REQUESTED</code> is stored as a
* controller configuration setting. It is evaluated and handled by the
* status dispatcher, which is invoked at regular intervals by APP through
* the <code>getInstanceStatus</code> method.
*
* @param settings
* a <code>ProvisioningSettings</code> object specifying the
* service parameters and configuration settings
* @return an <code>InstanceDescription</code> instance describing the
* application instance
* @throws APPlatformException
*/
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public InstanceDescription createInstance(ProvisioningSettings settings)
throws APPlatformException {
try {
PropertyHandler ph = new PropertyHandler(settings);
validateStackName(ph);
ph.setState(FlowState.CREATION_REQUESTED);
// Return generated instance information
InstanceDescription id = new InstanceDescription();
id.setInstanceId("stack-" + UUID.randomUUID().toString());
id.setBaseUrl("baseurl");
id.setChangedParameters(settings.getParameters());
id.setChangedAttributes(settings.getAttributes());
LOGGER.info("createInstance({})", LogAndExceptionConverter
.getLogText(id.getInstanceId(), settings));
return id;
} catch (Exception t) {
throw LogAndExceptionConverter.createAndLogPlatformException(t,
Context.CREATION);
}
}
示例10: getProperties
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public List<JmdTaskProperty> getProperties(Long taskId) {
Connection connection = null;
List<JmdTaskProperty> result = new ArrayList<>();
try {
connection = ds.getConnection();
result = new PostgreSqlBuilder().select(connection, Query
.SELECT(JMD_TASK_PROPERTY.columns())
.FROM(TABLE.JMD_TASK_PROPERTY())
.WHERE(JMD_TASK_PROPERTY.TASK_FK(), Condition.EQUALS, taskId),
JmdTaskProperty.class
);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "RESULT:{0}", result);
}
return result;
}
示例11: rerunTask
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void rerunTask(Long taskId) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "{0}", taskId);
}
JmdTask task = taskDao.getTask(taskId);
if (task != null) {
switch (TaskStatus.valueOf(task.getStatus())) {
case INTERRUPTED:
case STOPPED:
case FINISHED:
case FAILED:
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Rerunning task with id {0}", taskId);
}
String queueId = task.getQueueId();
if (task.getKillFlag()) {
taskDao.setKillFlag(taskId, false);
}
queueTask(taskId, queueId);
break;
}
}
}
示例12: setStopEnabled
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void setStopEnabled(Long taskId, Boolean stopEnabled) {
Connection connection = null;
try {
connection = ds.getConnection();
new OraSqlBuilder().update(connection, Query
.UPDATE(TABLE.JMD_TASK())
.SET(JMD_TASK.STOP_ENABLED(), stopEnabled)
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
} catch (SQLException e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.close(connection);
}
}
示例13: createInstance
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public InstanceDescription createInstance(ProvisioningSettings settings)
throws APPlatformException {
try {
VMPropertyHandler ph = new VMPropertyHandler(settings);
ph.setRequestingUser(settings.getRequestingUser());
InstanceDescription id = new InstanceDescription();
id.setInstanceId(Long.toString(System.currentTimeMillis()));
id.setChangedParameters(settings.getParameters());
if (platformService.exists(Controller.ID, id.getInstanceId())) {
logger.error(
"Other instance with same name already registered in CTMG: ["
+ id.getInstanceId() + "]");
throw new APPlatformException(
Messages.getAll("error_instance_exists",
new Object[] { id.getInstanceId() }));
}
validateParameters(null, ph, settings.getOrganizationId(),
id.getInstanceId());
logger.info("createInstance({})", LogAndExceptionConverter
.getLogText(id.getInstanceId(), settings));
StateMachine.initializeProvisioningSettings(settings,
"create_vm.xml");
return id;
} catch (Exception e) {
throw LogAndExceptionConverter.createAndLogPlatformException(e,
Context.CREATION);
}
}
示例14: deleteTask
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void deleteTask(Long taskId) {
Connection connection = null;
try {
connection = ds.getConnection();
connection.setAutoCommit(false);
List<JmdTaskData> dataList = getDataList(connection, taskId);
new PostgreSqlBuilder().delete(connection, Query
.DELETE()
.FROM(TABLE.JMD_TASK())
.WHERE(JMD_TASK.ID(), Condition.EQUALS, taskId)
);
new TaskAppFile().deleteFiles(getTmpDir(connection), dataList);
connection.commit();
} catch (Exception e) {
LOGGER.log(Level.SEVERE, e.toString(), e);
throw new RuntimeException(e);
} finally {
SqlUtil.enableAutoCommit(connection);
SqlUtil.close(connection);
}
}
示例15: deleteUsers
@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public InstanceStatus deleteUsers(String instanceId,
ProvisioningSettings settings, List<ServiceUser> users)
throws APPlatformException {
return null;
}