Refine search
@Override protected void executeReadMetricStep(final OperationContext context, final ModelNode operation, final EJBComponent component) throws OperationFailedException { context.getResult().setEmptyObject(); for (final Map.Entry<String, InvocationMetrics.Values> entry : component.getInvocationMetrics().getMethods().entrySet()) { final InvocationMetrics.Values values = entry.getValue(); final ModelNode result = new ModelNode(); result.get("execution-time").set(values.getExecutionTime()); result.get("invocations").set(values.getInvocations()); result.get("wait-time").set(values.getWaitTime()); context.getResult().get(entry.getKey()).set(result); } } });
private void parseJDBCStoreTableElements(XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException { while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) { XMLElement element = XMLElement.forName(reader.getLocalName()); switch (element) { case ID_COLUMN: { this.parseJDBCStoreColumn(reader, ColumnAttribute.ID, operation.get(TableResourceDefinition.ColumnAttribute.ID.getName()).setEmptyObject()); break; } case DATA_COLUMN: { this.parseJDBCStoreColumn(reader, ColumnAttribute.DATA, operation.get(TableResourceDefinition.ColumnAttribute.DATA.getName()).setEmptyObject()); break; } case TIMESTAMP_COLUMN: { this.parseJDBCStoreColumn(reader, ColumnAttribute.TIMESTAMP, operation.get(TableResourceDefinition.ColumnAttribute.TIMESTAMP.getName()).setEmptyObject()); break; } default: { throw ParseUtils.unexpectedElement(reader); } } } }
@Override public ModelNode getValue() { if (obj == null) { // An empty Object "{}". Calling the constructor // makes the ModelNode undefined. obj = new ModelNode(); obj.setEmptyObject(); } return obj; }
@Override protected void populateModel(final ModelNode operation, final ModelNode submodel) throws OperationFailedException { if (operation.hasDefined(SOCKET_BINDING)) { submodel.get(SOCKET_BINDING).set(operation.require(SOCKET_BINDING)); } if (operation.hasDefined(PROPERTIES)) { submodel.get(PROPERTIES).set(operation.require(PROPERTIES)); } submodel.get(SECURITY_CONFIG).setEmptyObject(); submodel.get(MODULE).setEmptyObject(); }
@Override public void handleResult(OperationContext.ResultAction resultAction, OperationContext context, ModelNode operation) { // On the way out, fix up the response final boolean isDomain = isDomainOperation(operation); boolean shouldContinue = collectDomainFailure(context, isDomain); shouldContinue = shouldContinue && collectContextFailure(context, isDomain); shouldContinue = shouldContinue && collectHostFailures(context, isDomain); if(shouldContinue){ ModelNode contextResult = context.getResult(); contextResult.setEmptyObject(); // clear out any old data contextResult.set(getDomainResults(operation)); if (domainOperationContext.getServerResults().size() > 0) { populateServerGroupResults(context); } else { // Just make sure there's an 'undefined' server-groups node context.getServerResults(); } } } });
public static ModelNode getDescriptionOnlyOperation(final ResourceBundle bundle, final String operationName, final String descriptionPrefix) { final ModelNode node = new ModelNode(); node.get(OPERATION_NAME).set(operationName); String descriptionKey = descriptionPrefix == null ? operationName : descriptionPrefix + "." + operationName; node.get(DESCRIPTION).set(bundle.getString(descriptionKey)); node.get(REQUEST_PROPERTIES).setEmptyObject(); node.get(REPLY_PROPERTIES).setEmptyObject(); return node; }
@Override protected void populateModel(final ModelNode operation, final ModelNode submodel) throws OperationFailedException { if (operation.hasDefined(SOCKET_BINDING)) { submodel.get(SOCKET_BINDING).set(operation.require(SOCKET_BINDING)); } if (operation.hasDefined(PROPERTIES)) { submodel.get(PROPERTIES).set(operation.require(PROPERTIES)); } submodel.get(SECURITY_CONFIG).setEmptyObject(); submodel.get(MODULE).setEmptyObject(); }
private static void populate(ModelNode source, ModelNode target) { for (String connectorType : CONNECTORS) { target.get(connectorType).setEmptyObject(); } }
@Override public ModelNode getValue() { if (obj == null) { // An empty Object "{}". Calling the constructor // makes the ModelNode undefined. obj = new ModelNode(); obj.setEmptyObject(); } return obj; }
public static ModelNode getDescriptionOnlyOperation(final ResourceBundle bundle, final String operationName, final String descriptionPrefix) { final ModelNode node = new ModelNode(); node.get(OPERATION_NAME).set(operationName); String descriptionKey = descriptionPrefix == null ? operationName : descriptionPrefix + "." + operationName; node.get(DESCRIPTION).set(bundle.getString(descriptionKey)); node.get(REQUEST_PROPERTIES).setEmptyObject(); node.get(REPLY_PROPERTIES).setEmptyObject(); return node; }
@Override public ModelReference set(PathAddress value) { if (value == null) return asValue(ModelReference.class); ModelNode dmr = this.value.setEmptyObject(); dmr.get("_ref").set(value.toString()); return (ModelReference) asValue(dmr); } }
/** * {@inheritDoc} */ @Override protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { model.setEmptyObject(); model.get(MailSubsystemModel.MAIL_SESSION); } }
@Override public void addStep(final ModelNode operation, final OperationStepHandler step, final Stage stage, final boolean addFirst) throws IllegalArgumentException { final ModelNode response = activeStep == null ? new ModelNode().setEmptyObject() : activeStep.response; addStep(response, operation, null, null, step, stage, addFirst); }
@Override public ModelNode getModelDescription(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode operation = new ModelNode(); operation.get(OPERATION_NAME).set(ADD); operation.get(DESCRIPTION).set(bundle.getString("polyglot-cache.add")); operation.get(REQUEST_PROPERTIES).setEmptyObject(); operation.get(REPLY_PROPERTIES).setEmptyObject(); return operation; } };
@Override protected Object handleOperation(String operationName, OperationContext context, ModelNode operation) throws OperationFailedException { if (ClusterConnectionDefinition.GET_NODES.equals(operationName)) { ClusterConnectionControl control = getActiveMQComponentControl(context, operation, false); try { Map<String, String> nodes = control.getNodes(); final ModelNode result = context.getResult(); result.setEmptyObject(); for (Map.Entry<String, String> entry : nodes.entrySet()) { result.get(entry.getKey()).set(entry.getValue()); } } catch (Exception e) { context.getFailureDescription().set(e.getLocalizedMessage()); } } else { unsupportedOperation(operationName); } return null; } }
protected void populateModel(ModelNode operation, ModelNode model) { model.setEmptyObject(); model.get(RESOURCEADAPTER_NAME); }
@Override public void addStep(final ModelNode operation, final OperationStepHandler step, final Stage stage) throws IllegalArgumentException { final ModelNode response = activeStep == null ? new ModelNode().setEmptyObject() : activeStep.response; addStep(response, operation, null, step, stage); }
@Override public ModelNode getModelDescription(Locale locale) { final ResourceBundle bundle = getResourceBundle(locale); final ModelNode operation = new ModelNode(); operation.get(OPERATION_NAME).set(ADD); operation.get(DESCRIPTION).set(bundle.getString("polyglot-hasingleton.add")); operation.get(REQUEST_PROPERTIES).setEmptyObject(); operation.get(REPLY_PROPERTIES).setEmptyObject(); return operation; } };
@Override protected Object handleOperation(String operationName, OperationContext context, ModelNode operation) throws OperationFailedException { if (ClusterConnectionDefinition.GET_NODES.equals(operationName)) { ClusterConnectionControl control = getActiveMQComponentControl(context, operation, false); try { Map<String, String> nodes = control.getNodes(); final ModelNode result = context.getResult(); result.setEmptyObject(); for (Map.Entry<String, String> entry : nodes.entrySet()) { result.get(entry.getKey()).set(entry.getValue()); } } catch (Exception e) { context.getFailureDescription().set(e.getLocalizedMessage()); } } else { unsupportedOperation(operationName); } return null; } }
protected void populateModel(ModelNode operation, ModelNode model) { model.setEmptyObject(); model.get(RESOURCEADAPTER_NAME); }