org.infinispan.counter.impl.manager.ClusteredCounterPackageImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-clustered-counter Show documentation
Show all versions of infinispan-clustered-counter Show documentation
Infinispan Clustered Counter module
package org.infinispan.counter.impl.manager;
import java.util.Arrays;
import java.util.Collections;
import javax.annotation.processing.Generated;
import org.infinispan.factories.impl.ComponentAccessor;
import org.infinispan.factories.impl.ModuleMetadataBuilder;
import org.infinispan.factories.impl.MBeanMetadata;
import org.infinispan.factories.impl.MBeanMetadata.AttributeMetadata;
import org.infinispan.factories.impl.MBeanMetadata.OperationMetadata;
import org.infinispan.factories.impl.MBeanMetadata.OperationParameterMetadata;
import org.infinispan.factories.impl.WireContext;
import org.infinispan.lifecycle.ModuleLifecycle;
/**
* @api.private
*/
@Generated(value = "org.infinispan.component.processor.Generator", date = "2024-08-22T08:22:32.924133179Z")
public final class ClusteredCounterPackageImpl {
public static void registerMetadata(ModuleMetadataBuilder.ModuleBuilder builder) {
//start org.infinispan.counter.impl.manager.CounterConfigurationManager
builder.registerComponentAccessor("org.infinispan.counter.impl.manager.CounterConfigurationManager",
Collections.emptyList(),
new ComponentAccessor("org.infinispan.counter.impl.manager.CounterConfigurationManager",
0, false, null,
Arrays.asList("org.infinispan.manager.EmbeddedCacheManager", "org.infinispan.counter.impl.manager.CounterConfigurationStorage")) {
protected void wire(CounterConfigurationManager instance, WireContext context, boolean start) {
instance.cacheManager = context.get("org.infinispan.manager.EmbeddedCacheManager", org.infinispan.manager.EmbeddedCacheManager.class, start);
instance.storage = context.get("org.infinispan.counter.impl.manager.CounterConfigurationStorage", org.infinispan.counter.impl.manager.CounterConfigurationStorage.class, start);
}
protected void start(CounterConfigurationManager instance) throws Exception {
instance.start();
}
protected void stop(CounterConfigurationManager instance) throws Exception {
instance.stop();
}
});
//start org.infinispan.counter.impl.manager.PersistedCounterConfigurationStorage
builder.registerComponentAccessor("org.infinispan.counter.impl.manager.PersistedCounterConfigurationStorage",
Collections.emptyList(),
new ComponentAccessor("org.infinispan.counter.impl.manager.PersistedCounterConfigurationStorage",
0, false, null,
Collections.emptyList()));
//start org.infinispan.counter.impl.manager.EmbeddedCounterManager
builder.registerComponentAccessor("org.infinispan.counter.impl.manager.EmbeddedCounterManager",
Collections.emptyList(),
new ComponentAccessor("org.infinispan.counter.impl.manager.EmbeddedCounterManager",
0, false, null,
Arrays.asList("org.infinispan.counter.impl.manager.CounterConfigurationManager", "org.infinispan.counter.impl.listener.CounterManagerNotificationManager", "org.infinispan.counter.impl.factory.StrongCounterFactory", "org.infinispan.counter.impl.factory.WeakCounterFactory")) {
protected void wire(EmbeddedCounterManager instance, WireContext context, boolean start) {
instance.configurationManager = context.get("org.infinispan.counter.impl.manager.CounterConfigurationManager", org.infinispan.counter.impl.manager.CounterConfigurationManager.class, start);
instance.notificationManager = context.get("org.infinispan.counter.impl.listener.CounterManagerNotificationManager", org.infinispan.counter.impl.listener.CounterManagerNotificationManager.class, start);
instance.strongCounterFactory = context.get("org.infinispan.counter.impl.factory.StrongCounterFactory", org.infinispan.counter.impl.factory.StrongCounterFactory.class, start);
instance.weakCounterFactory = context.get("org.infinispan.counter.impl.factory.WeakCounterFactory", org.infinispan.counter.impl.factory.WeakCounterFactory.class, start);
}
protected void start(EmbeddedCounterManager instance) throws Exception {
instance.start();
}
protected void stop(EmbeddedCounterManager instance) throws Exception {
instance.stop();
}
});
builder.registerMBeanMetadata("org.infinispan.counter.impl.manager.EmbeddedCounterManager",
MBeanMetadata.of("CounterManager", "Component to manage counters", null,
new OperationMetadata("remove", "remove", "Removes the counter's value from the cluster. The counter will be re-created when access next time.", "void",
new OperationParameterMetadata("counterName", "java.lang.String", "null")
),
new OperationMetadata("getCounterNames", "counters", "Returns a collection of defined counter's name.", "java.util.Collection"
),
new OperationMetadata("getValue", "value", "Returns the current counter's value", "long",
new OperationParameterMetadata("counterName", "java.lang.String", "null")
),
new OperationMetadata("reset", "reset", "Resets the counter's value", "void",
new OperationParameterMetadata("counterName", "java.lang.String", "null")
),
new OperationMetadata("getCounterConfiguration", "configuration", "Returns the counter's configuration", "java.util.Properties",
new OperationParameterMetadata("counterName", "java.lang.String", "null")
)
));
//start org.infinispan.counter.impl.manager.VolatileCounterConfigurationStorage
builder.registerComponentAccessor("org.infinispan.counter.impl.manager.VolatileCounterConfigurationStorage",
Collections.emptyList(),
new ComponentAccessor("org.infinispan.counter.impl.manager.VolatileCounterConfigurationStorage",
0, false, null,
Collections.emptyList()));
//end
}
}