Search in sources :

Example 6 with AdminException

use of org.apache.geode.admin.AdminException in project geode by apache.

the class RemoteGemFireVM method createSubregion.

public Region createSubregion(CacheInfo c, String parentPath, String regionPath, RegionAttributes attrs) throws AdminException {
    RegionResponse resp = (RegionResponse) sendAndWait(RegionRequest.createForCreateSubregion(c, parentPath, regionPath, attrs));
    Exception ex = resp.getException();
    if (ex != null) {
        throw new AdminException(LocalizedStrings.RemoteGemFireVM_WHILE_CREATING_SUBREGION_0_OF_1.toLocalizedString(new Object[] { regionPath, parentPath }), ex);
    } else {
        return resp.getRegion(this);
    }
}
Also used : AdminException(org.apache.geode.admin.AdminException) AdminException(org.apache.geode.admin.AdminException) OperationCancelledException(org.apache.geode.admin.OperationCancelledException)

Example 7 with AdminException

use of org.apache.geode.admin.AdminException in project geode by apache.

the class ConnectionNotificationFilterImpl method initializeHelperMbean.

private void initializeHelperMbean() {
    try {
        memberInfoWithStatsMBean = new MemberInfoWithStatsMBean(this);
        MBeanServer mbs = getMBeanServer();
        mbs.registerMBean(memberInfoWithStatsMBean, memberInfoWithStatsMBean.getObjectName());
    /*
       * We are not re-throwing these exceptions as failure create/register the GemFireTypesWrapper
       * will not stop the Agent from working. But we are logging it as it could be an indication of
       * some problem. Also not creating Localized String for the exception.
       */
    } catch (OperationsException e) {
        logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
    } catch (MBeanRegistrationException e) {
        logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
    } catch (AdminException e) {
        logger.info(LocalizedMessage.create(LocalizedStrings.AgentImpl_FAILED_TO_INITIALIZE_MEMBERINFOWITHSTATSMBEAN), e);
    }
}
Also used : AdminException(org.apache.geode.admin.AdminException) MBeanRegistrationException(javax.management.MBeanRegistrationException) MBeanServer(javax.management.MBeanServer) OperationsException(javax.management.OperationsException)

Example 8 with AdminException

use of org.apache.geode.admin.AdminException in project geode by apache.

the class StatisticResourceImpl method refresh.

// -------------------------------------------------------------------------
// Operations
// -------------------------------------------------------------------------
public void refresh() throws org.apache.geode.admin.AdminException {
    Stat[] stats = null;
    if (this.statResource != null) {
        stats = this.statResource.getStats();
    }
    if (stats == null || stats.length < 1) {
        throw new AdminException(LocalizedStrings.StatisticResourceImpl_FAILED_TO_REFRESH_STATISTICS_0_FOR_1.toLocalizedString(getType() + "-" + getName(), getOwner()));
    }
    if (this.statistics == null || this.statistics.length < 1) {
        // define new statistics instances...
        List statList = new ArrayList();
        for (int i = 0; i < stats.length; i++) {
            statList.add(createStatistic(stats[i]));
        }
        this.statistics = (Statistic[]) statList.toArray(new Statistic[0]);
    } else {
        // update the existing instances...
        for (int i = 0; i < stats.length; i++) {
            updateStatistic(stats[i]);
        }
    }
}
Also used : AdminException(org.apache.geode.admin.AdminException) Stat(org.apache.geode.internal.admin.Stat) Statistic(org.apache.geode.admin.Statistic) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 9 with AdminException

use of org.apache.geode.admin.AdminException in project geode by apache.

the class RemoteGemFireVM method createVMRootRegion.

public Region createVMRootRegion(CacheInfo c, String regionPath, RegionAttributes attrs) throws AdminException {
    RegionResponse resp = (RegionResponse) sendAndWait(RegionRequest.createForCreateRoot(c, regionPath, attrs));
    Exception ex = resp.getException();
    if (ex != null) {
        throw new AdminException(LocalizedStrings.RemoteGemFireVM_AN_EXCEPTION_WAS_THROWN_WHILE_CREATING_VM_ROOT_REGION_0.toLocalizedString(regionPath), ex);
    } else {
        return resp.getRegion(this);
    }
}
Also used : AdminException(org.apache.geode.admin.AdminException) AdminException(org.apache.geode.admin.AdminException) OperationCancelledException(org.apache.geode.admin.OperationCancelledException)

Example 10 with AdminException

use of org.apache.geode.admin.AdminException in project geode by apache.

the class RemoteGemFireVM method startBridgeServer.

public AdminBridgeServer startBridgeServer(CacheInfo cache, AdminBridgeServer bridge) throws AdminException {
    BridgeServerRequest request = BridgeServerRequest.createForStart(cache, (RemoteBridgeServer) bridge);
    BridgeServerResponse response = (BridgeServerResponse) sendAndWait(request);
    if (response.getException() != null) {
        Exception ex = response.getException();
        throw new AdminException(ex.getMessage(), ex);
    } else {
        return response.getBridgeInfo();
    }
}
Also used : AdminException(org.apache.geode.admin.AdminException) AdminException(org.apache.geode.admin.AdminException) OperationCancelledException(org.apache.geode.admin.OperationCancelledException)

Aggregations

AdminException (org.apache.geode.admin.AdminException)16 DistributedSystemConfig (org.apache.geode.admin.DistributedSystemConfig)8 AdminDistributedSystem (org.apache.geode.admin.AdminDistributedSystem)7 OperationCancelledException (org.apache.geode.admin.OperationCancelledException)6 Set (java.util.Set)4 SerializableCallable (org.apache.geode.test.dunit.SerializableCallable)4 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)4 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)4 Test (org.junit.Test)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 BackupStatus (org.apache.geode.admin.BackupStatus)3 PersistentID (org.apache.geode.cache.persistence.PersistentID)3 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)3 Host (org.apache.geode.test.dunit.Host)3 VM (org.apache.geode.test.dunit.VM)3 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)3 Cache (org.apache.geode.cache.Cache)2 Region (org.apache.geode.cache.Region)2 DiskRegion (org.apache.geode.internal.cache.DiskRegion)2