Package org.jboss.managed.api

Examples of org.jboss.managed.api.ManagedComponent


 
 
  @Override
  public void clearCache(String cacheType) throws AdminException{
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      ManagedUtil.executeOperation(mc, "clearCache", SimpleValueSupport.wrap(cacheType));//$NON-NLS-1$
    } catch (Exception e) {
      throw new AdminComponentException(e.getMessage(), e);
    }    
  }
View Full Code Here


  }
 
  @Override
  public void clearCache(String cacheType, String vdbName, int version) throws AdminException{
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      ManagedUtil.executeOperation(mc, "clearCache", SimpleValueSupport.wrap(cacheType), //$NON-NLS-1$
          SimpleValueSupport.wrap(vdbName), SimpleValueSupport.wrap(version));
    } catch (Exception e) {
      throw new AdminComponentException(e.getMessage(), e);
    }    
View Full Code Here

 
  @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));
      }
View Full Code Here

 
 
  @Override
  public void terminateTransaction(String xid) throws AdminException {
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      ManagedUtil.executeOperation(mc, "terminateTransaction", MetaValueFactory.getInstance().create(xid));//$NON-NLS-1$
    } catch (Exception e) {
      throw new AdminComponentException(e.getMessage(), e);
    }  
  }
View Full Code Here

  }
 
  @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

  }
   
    @Override
    public void changeVDBConnectionType(String vdbName, int vdbVersion,
        ConnectionType type) throws AdminException {
      ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
    if (mc == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("vdb_not_found", vdbName, vdbVersion)); //$NON-NLS-1$
    }
   
      ManagedProperty connectionTypeProperty = mc.getProperty("connectionType"); //$NON-NLS-1$
      if (connectionTypeProperty != null) {
        connectionTypeProperty.setValue(ManagedUtil.wrap(new EnumMetaType(ConnectionType.values()), type != null ?type.name():ConnectionType.BY_VERSION.name()));
      }
   
    try {
View Full Code Here

    }
    }

  @Override
  public void assignToModel(String vdbName, int vdbVersion, String modelName, String sourceName, String translatorName, String dsName) throws AdminException {
    ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
    if (mc == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("vdb_not_found", vdbName, vdbVersion)); //$NON-NLS-1$
    }
   
    ManagedProperty mp = mc.getProperty("models");//$NON-NLS-1$
    List<ManagedObject> models = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(mp.getValue());
    ManagedObject managedModel = null;
    if (models != null && !models.isEmpty()) {
      for(ManagedObject mo:models) {
        String name = ManagedUtil.getSimpleValue(mo, "name", String.class); //$NON-NLS-1$
View Full Code Here

      throw new AdminComponentException(e.getMessage(), e);
    }           
  }

  private void manageRoleToDataPolicy(String vdbName, int vdbVersion, String policyName, String role, boolean addthrows AdminException {
    ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
    if (mc == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("vdb_not_found", vdbName, vdbVersion)); //$NON-NLS-1$
    }
   
    ManagedProperty mp = mc.getProperty("dataPolicies");//$NON-NLS-1$
    List<ManagedObject> policies = (List<ManagedObject>)MetaValueFactory.getInstance().unwrap(mp.getValue());
    ManagedObject managedPolicy = null;
    if (policies != null && !policies.isEmpty()) {
      for(ManagedObject mo:policies) {
        String name = ManagedUtil.getSimpleValue(mo, "name", String.class); //$NON-NLS-1$
View Full Code Here

  }

  @Override
  public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException {
    try {
      ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE)
      ManagedUtil.executeOperation(mc, "mergeVDBs"//$NON-NLS-1$
          SimpleValueSupport.wrap(sourceVDBName),
          SimpleValueSupport.wrap(sourceVDBVersion),
          SimpleValueSupport.wrap(targetVDBName),
          SimpleValueSupport.wrap(targetVDBVersion));
View Full Code Here

      throw new AdminComponentException(e.getMessage(), e);
    }      
  }

  private ManagedComponent getDatasource(String deployedName) throws Exception {
    ManagedComponent mc = null;
    for (String type:DS_TYPES) {
      ComponentType ct = new ComponentType("DataSource", type); //$NON-NLS-1$
      mc = getView().getComponent(deployedName, ct);
      if (mc != null) {
        return mc;
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.ManagedComponent

Copyright © 2018 www.massapicom. 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.