當前位置: 首頁>>代碼示例>>Java>>正文


Java TransactionAttributeType.NOT_SUPPORTED屬性代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:20,代碼來源:TaskDaoImpl.java

示例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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:22,代碼來源:TaskDaoImpl.java

示例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;
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:26,代碼來源:TaskDaoImpl.java

示例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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:20,代碼來源:TaskDaoImpl.java

示例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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:20,代碼來源:TaskDaoTestImpl.java

示例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;
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:20,代碼來源:TaskDaoImpl.java

示例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);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:41,代碼來源:AWSController.java

示例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;
        }
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:19,代碼來源:TaskAppServiceImpl.java

示例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);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:41,代碼來源:OpenStackController.java

示例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;
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:26,代碼來源:TaskDaoImpl.java

示例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;
        }
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:25,代碼來源:TaskAppServiceImpl.java

示例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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:20,代碼來源:TaskDaoImpl.java

示例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);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:36,代碼來源:VMController.java

示例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);
    }
}
 
開發者ID:jmd-stuff,項目名稱:task-app,代碼行數:27,代碼來源:TaskDaoImpl.java

示例15: deleteUsers

@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public InstanceStatus deleteUsers(String instanceId,
        ProvisioningSettings settings, List<ServiceUser> users)
        throws APPlatformException {
    return null;
}
 
開發者ID:servicecatalog,項目名稱:oscm-app,代碼行數:7,代碼來源:IaasController.java


注:本文中的javax.ejb.TransactionAttributeType.NOT_SUPPORTED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。