Search in sources :

Example 1 with InstantiatorAttributesHolder

use of org.apache.geode.internal.InternalInstantiator.InstantiatorAttributesHolder in project geode by apache.

the class DiskInitFile method saveInstantiators.

private void saveInstantiators() {
    Object[] objects = InternalInstantiator.getInstantiatorsForSerialization();
    for (Object obj : objects) {
        if (obj instanceof Instantiator) {
            saveInstantiator((Instantiator) obj);
        } else {
            InstantiatorAttributesHolder iah = (InstantiatorAttributesHolder) obj;
            saveInstantiator(iah.getId(), iah.getInstantiatorClassName(), iah.getInstantiatedClassName());
        }
    }
}
Also used : InstantiatorAttributesHolder(org.apache.geode.internal.InternalInstantiator.InstantiatorAttributesHolder) InternalInstantiator(org.apache.geode.internal.InternalInstantiator) Instantiator(org.apache.geode.Instantiator)

Example 2 with InstantiatorAttributesHolder

use of org.apache.geode.internal.InternalInstantiator.InstantiatorAttributesHolder in project geode by apache.

the class PoolManagerImpl method allPoolsRegisterInstantiator.

public static void allPoolsRegisterInstantiator(InstantiatorAttributesHolder holder) {
    InstantiatorAttributesHolder[] holders = new InstantiatorAttributesHolder[1];
    holders[0] = holder;
    for (Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr.hasNext(); ) {
        PoolImpl next = (PoolImpl) itr.next();
        try {
            EventID eventId = InternalInstantiator.generateEventId();
            if (eventId == null) {
            // cache must not exist, do nothing
            } else {
                RegisterInstantiatorsOp.execute(next, holders, InternalInstantiator.generateEventId());
            }
        } catch (RuntimeException e) {
            logger.warn(LocalizedMessage.create(LocalizedStrings.PoolmanagerImpl_ERROR_REGISTERING_INSTANTIATOR_ON_POOL), e);
        } finally {
            next.releaseThreadLocalConnection();
        }
    }
}
Also used : InstantiatorAttributesHolder(org.apache.geode.internal.InternalInstantiator.InstantiatorAttributesHolder) Pool(org.apache.geode.cache.client.Pool) PoolImpl(org.apache.geode.cache.client.internal.PoolImpl)

Aggregations

InstantiatorAttributesHolder (org.apache.geode.internal.InternalInstantiator.InstantiatorAttributesHolder)2 Instantiator (org.apache.geode.Instantiator)1 Pool (org.apache.geode.cache.client.Pool)1 PoolImpl (org.apache.geode.cache.client.internal.PoolImpl)1 InternalInstantiator (org.apache.geode.internal.InternalInstantiator)1