@Override public ConcurrencyStrategy<EhcacheEntityMessage> getConcurrencyStrategy(byte[] config) { return delegate.getConcurrencyStrategy(config); }
@Override public ExecutionStrategy<EhcacheEntityMessage> getExecutionStrategy(byte[] configuration) { return delegate.getExecutionStrategy(configuration); }
@Override public MessageCodec<EhcacheEntityMessage, EhcacheEntityResponse> getMessageCodec() { return delegate.getMessageCodec(); }
public PassthroughServer build() { PassthroughServer newServer = new PassthroughServer(); /* * If services have been specified, don't establish the "defaults". */ if (serverEntityServices.isEmpty() && clientEntityServices.isEmpty()) { newServer.registerServerEntityService(new ClusterTierManagerServerEntityService()); newServer.registerClientEntityService(new ClusterTierManagerClientEntityService()); newServer.registerServerEntityService(new ClusterTierServerEntityService()); newServer.registerClientEntityService(new ClusterTierClientEntityService()); newServer.registerServerEntityService(new VoltronReadWriteLockServerEntityService()); newServer.registerClientEntityService(new VoltronReadWriteLockEntityClientService()); } for (EntityServerService<?, ?> service : serverEntityServices) { newServer.registerServerEntityService(service); } for (EntityClientService<?, ?, ? extends EntityMessage, ? extends EntityResponse, ?> service : clientEntityServices) { newServer.registerClientEntityService(service); } if (!this.resources.getResource().isEmpty()) { newServer.registerExtendedConfiguration(new OffHeapResourcesProvider(this.resources)); } for (Map.Entry<ServiceProvider, ServiceProviderConfiguration> entry : serviceProviders.entrySet()) { newServer.registerServiceProvider(entry.getKey(), entry.getValue()); } return newServer; } }
@Override public boolean handlesEntityType(String typeName) { return delegate.handlesEntityType(typeName); }
@Override public long getVersion() { return delegate.getVersion(); }
@Override public SyncMessageCodec<EhcacheEntityMessage> getSyncMessageCodec() { return delegate.getSyncMessageCodec(); }
@Override public ClusterTierActiveEntity createActiveEntity(ServiceRegistry registry, byte[] configuration) throws ConfigurationException { ClusterTierEntityConfiguration c = new EntityConfigurationCodec(new CommonConfigCodec()).decodeClusteredStoreConfiguration(configuration); ClusterTierActiveEntity activeEntity = delegate.createActiveEntity(registry, configuration); List<ClusterTierActiveEntity> existing = servedActiveEntities.putIfAbsent(c.getStoreIdentifier(), new ArrayList<>(singleton(activeEntity))); if (existing != null) { existing.add(activeEntity); } return activeEntity; }
@Override public ClusterTierPassiveEntity createPassiveEntity(ServiceRegistry registry, byte[] configuration) throws ConfigurationException { ClusterTierEntityConfiguration c = new EntityConfigurationCodec(new CommonConfigCodec()).decodeClusteredStoreConfiguration(configuration); ClusterTierPassiveEntity passiveEntity = delegate.createPassiveEntity(registry, configuration); List<ClusterTierPassiveEntity> existing = servedPassiveEntities.putIfAbsent(c.getStoreIdentifier(), new ArrayList<>(singleton(passiveEntity))); if (existing != null) { existing.add(passiveEntity); } return passiveEntity; }
@Before public void setUp() throws Exception { this.clusterControl = PassthroughTestHelpers.createActivePassive(STRIPENAME, server -> { server.registerServerEntityService(new ClusterTierManagerServerEntityService()); server.registerClientEntityService(new ClusterTierManagerClientEntityService()); server.registerServerEntityService(new ClusterTierServerEntityService()); server.registerClientEntityService(new ClusterTierClientEntityService()); server.registerServerEntityService(new VoltronReadWriteLockServerEntityService()); server.registerClientEntityService(new VoltronReadWriteLockEntityClientService()); server.registerExtendedConfiguration(new OffHeapResourcesProvider(getOffheapResourcesType("test", 32, MemoryUnit.MB))); UnitTestConnectionService.addServerToStripe(STRIPENAME, server); } ); clusterControl.waitForActive(); clusterControl.waitForRunningPassivesInStandby(); }
server.registerServerEntityService(new ClusterTierManagerServerEntityService()); server.registerClientEntityService(new ClusterTierManagerClientEntityService()); server.registerServerEntityService(new ClusterTierServerEntityService()); server.registerClientEntityService(new ClusterTierClientEntityService()); server.registerServerEntityService(new VoltronReadWriteLockServerEntityService());