Examples of MetaValue


Examples of org.jboss.metatype.api.values.MetaValue

  @Override
  public Collection<Transaction> getTransactions() throws AdminException {
    try {
      Collection<Transaction> txnList = new ArrayList<Transaction>();
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      MetaValue value = ManagedUtil.executeOperation(mc, "getTransactions");//$NON-NLS-1$
      MetaValue[] requests = ((CollectionValueSupport)value).getElements();
      for (MetaValue mv:requests) {
        txnList.add((TransactionMetadata)MetaValueFactory.getInstance().unwrap(mv, TransactionMetadata.class));
      }
      return txnList;
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

 
  @Override
  public WorkerPoolStatistics getWorkerPoolStats() throws AdminException {
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);
      MetaValue value = ManagedUtil.executeOperation(mc, "getWorkerPoolStatistics");//$NON-NLS-1$
      return (WorkerPoolStatistics)MetaValueFactory.getInstance().unwrap(value, WorkerPoolStatisticsMetadata.class)
    } catch (Exception e) {
      throw new AdminComponentException(e.getMessage(), e);
    }
  } 
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

  @Override
  public CacheStatistics getCacheStats(String cacheType) throws AdminException {
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);
      MetaValue value = ManagedUtil.executeOperation(mc, "getCacheStatistics", SimpleValueSupport.wrap(cacheType));//$NON-NLS-1$
      return (CacheStatistics)MetaValueFactory.getInstance().unwrap(value, CacheStatisticsMetadata.class)
    } catch (Exception e) {
      throw new AdminComponentException(e.getMessage(), e);
    }
  }
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

  private Object getCacheProperty(ProfileServiceConnection connection,String metric) {
    int dotIndex = metric.indexOf('.');
    String cacheType = metric.substring(0, dotIndex);
    String property = metric.substring(dotIndex + 1);
    CompositeValueSupport mv = (CompositeValueSupport) getCacheStats(connection, cacheType);
    MetaValue v = mv.get(property);
    return ((SimpleValue) v).getValue();
  }
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

      List<String> fieldNameList = operationResult.getFieldNameList();
      getRequestCollectionValue(getLongRunningQueries(connection),  resultObject);
      operationResult.setContent(createReportResultList(fieldNameList,  resultObject.iterator()));
    } else if (operationName.equals(Platform.Operations.GET_SESSIONS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue sessionMetaValue = getSessions(connection);
      getSessionCollectionValue(sessionMetaValue,activeSessionsCollection);
      operationResult.setContent(createReportResultList(fieldNameList,  activeSessionsCollection.iterator()));
    } else if (operationName.equals(Platform.Operations.GET_REQUESTS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue requestMetaValue = getRequests(connection);
      getRequestCollectionValue(requestMetaValue, resultObject);
      operationResult.setContent(createReportResultList(fieldNameList,  resultObject.iterator()));
    } else if (operationName.equals(Platform.Operations.GET_TRANSACTIONS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue transactionMetaValue = getTransactions(connection);
      getTransactionCollectionValue(transactionMetaValue,transactionsCollection);
      operationResult.setContent(createReportResultList(fieldNameList,  resultObject.iterator()));
    } else if (operationName.equals(Platform.Operations.KILL_TRANSACTION)) {
      String sessionID = (String) valueMap.get(Operation.Value.TRANSACTION_ID);
      MetaValue[] args = new MetaValue[] { SimpleValueSupport.wrap(sessionID) };
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

      List<String> fieldNameList = operationResult.getFieldNameList();
      getProperties(connection, PluginConstants.ComponentType.VDB.NAME);
      operationResult.setContent(createReportResultList(fieldNameList,  resultObject.iterator()));
    } else if (operationName.equals(VDB.Operations.GET_SESSIONS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue sessionMetaValue = getSessions(connection);
      getSessionCollectionValueForVDB(sessionMetaValue, activeSessionsCollection, vdbName);
      operationResult.setContent(createReportResultList(fieldNameList,  activeSessionsCollection.iterator()));
    } else if (operationName.equals(VDB.Operations.GET_REQUESTS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue requestMetaValue = getRequestsForVDB(connection, vdbName,  Integer.parseInt(vdbVersion));
      getRequestCollectionValue(requestMetaValue, resultObject);
      operationResult.setContent(createReportResultList(fieldNameList,  resultObject.iterator()));
    } else if (operationName.equals(VDB.Operations.GET_MATVIEWS)) {
      List<String> fieldNameList = operationResult.getFieldNameList();
      MetaValue resultsMetaValue = executeMaterializedViewQueryconnection, vdbName, Integer.parseInt(vdbVersion));
      getResultsCollectionValue(resultsMetaValue, sqlResultsObject);
      operationResult.setContent(createReportResultListForMatViewQuery(fieldNameList, sqlResultsObject.iterator()));
    } else if (operationName.equals(VDB.Operations.CLEAR_CACHE)) {
     
      try {
      executeClearCacheconnection, vdbName, Integer.parseInt(vdbVersion),
          (String) valueMap.get(Operation.Value.CACHE_TYPE));
       
      }catch(Exception e){
        //Some failure during Clear Cache. Set message here since it has already been logged.
        operationResult.setContent("failure - see log for details"); //$NON-NLS-1$
      }

      //If no exceptions, we assume the clear cache worked
      operationResult.setContent("cache successfully cleared!"); //$NON-NLS-1$
   
    } else if (operationName.equals(VDB.Operations.RELOAD_MATVIEW)) {
      MetaValue resultsMetaValue = reloadMaterializedView(connection,  vdbName, Integer.parseInt(vdbVersion),
          (String) valueMap.get(Operation.Value.MATVIEW_SCHEMA),
          (String) valueMap.get(Operation.Value.MATVIEW_TABLE),
          (Boolean) valueMap.get(Operation.Value.INVALIDATE_MATVIEW));
      if (resultsMetaValue==null) {
        operationResult.setContent("failure - see log for details"); //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

    return vdbName.substring(0, vdbName.lastIndexOf(".")); //$NON-NLS-1$
  }

  public MetaValue getProperties(ProfileServiceConnection connection,  final String component) {

    MetaValue propertyValue = null;
    MetaValue args = null;

    try {
      propertyValue = executeManagedOperation(connection,  getRuntimeEngineDeployer(connection, mc),
          PluginConstants.Operation.GET_PROPERTIES, args);
    } catch (Exception e) {
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

  }

  protected MetaValue getRequests(ProfileServiceConnection connection) {

    MetaValue requestsCollection = null;
    MetaValue args = null;

    try {
      requestsCollection = executeManagedOperation(connection,  getRuntimeEngineDeployer(connection, mc),  PluginConstants.Operation.GET_REQUESTS, args);
    } catch (Exception e) {
      final String msg = "Exception executing operation: " + Platform.Operations.GET_REQUESTS; //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

  }
 
  protected MetaValue executeMaterializedViewQuery(
      ProfileServiceConnection connection, String vdbName, int vdbVersion) {

    MetaValue resultsCollection = null;
    MetaValue[] args = new MetaValue[] {
        SimpleValueSupport.wrap(vdbName),
        SimpleValueSupport.wrap(vdbVersion),
        SimpleValueSupport.wrap(Operation.Value.MAT_VIEW_QUERY)
        SimpleValueSupport.wrap(Long.parseLong("9999999")) }; //$NON-NLS-1$
View Full Code Here

Examples of org.jboss.metatype.api.values.MetaValue

  protected MetaValue reloadMaterializedView(
      ProfileServiceConnection connection, String vdbName,
      int vdbVersion, String schema, String table, Boolean invalidate) {

    MetaValue result = null;
    String matView = schema + "." + table; //$NON-NLS-1$
    String query = PluginConstants.Operation.Value.MAT_VIEW_REFRESH;
    query = query.replace("param1", matView); //$NON-NLS-1$
    query = query.replace("param2", invalidate.toString()); //$NON-NLS-1$
    MetaValue[] args = new MetaValue[] {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.