use of org.onlab.util.KryoNamespace in project onos by opennetworkinglab.
the class DistributedWorkplaceStore method activate.
@Activate
public void activate() {
appId = coreService.registerApplication("org.onosproject.workplacestore");
log.info("appId=" + appId);
KryoNamespace workplaceNamespace = KryoNamespace.newBuilder().register(KryoNamespaces.API).register(WorkflowData.class).register(Workplace.class).register(DefaultWorkplace.class).register(WorkflowContext.class).register(DefaultWorkflowContext.class).register(SystemWorkflowContext.class).register(WorkflowState.class).register(ProgramCounter.class).register(DataModelTree.class).register(JsonDataModelTree.class).register(List.class).register(ArrayList.class).register(JsonNode.class).register(ObjectNode.class).register(TextNode.class).register(LinkedHashMap.class).register(ArrayNode.class).register(BaseJsonNode.class).register(BigIntegerNode.class).register(BinaryNode.class).register(BooleanNode.class).register(ContainerNode.class).register(DecimalNode.class).register(DoubleNode.class).register(FloatNode.class).register(IntNode.class).register(JsonNodeType.class).register(LongNode.class).register(MissingNode.class).register(NullNode.class).register(NumericNode.class).register(POJONode.class).register(ShortNode.class).register(ValueNode.class).register(JsonNodeCreator.class).register(JsonNodeFactory.class).build();
localWorkplaceMap.clear();
workplaceMap = storageService.<String, WorkflowData>consistentMapBuilder().withSerializer(Serializer.using(workplaceNamespace)).withName("workplace-map").withApplicationId(appId).build();
workplaceMap.addListener(workplaceMapEventListener);
localContextMap.clear();
contextMap = storageService.<String, WorkflowData>consistentMapBuilder().withSerializer(Serializer.using(workplaceNamespace)).withName("workflow-context-map").withApplicationId(appId).build();
contextMap.addListener(contextMapEventListener);
workplaceMapEventListener.syncLocal();
contextMapEventListener.syncLocal();
log.info("Started");
}
use of org.onlab.util.KryoNamespace in project onos by opennetworkinglab.
the class AbstractDistributedP4RuntimeMirror method activate.
@Activate
public void activate() {
final String fullMapName = format(MAP_NAME_TEMPLATE, mapSimpleName());
final KryoNamespace serializer = KryoNamespace.newBuilder().register(KryoNamespaces.API).register(TimedEntry.class).build();
mirrorMap = storageService.<PiHandle, TimedEntry<E>>eventuallyConsistentMapBuilder().withName(fullMapName).withSerializer(serializer).withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
annotationsMap = storageService.<PiHandle, Annotations>eventuallyConsistentMapBuilder().withName(fullMapName + "-annotations").withSerializer(serializer).withTimestampProvider((k, v) -> new WallClockTimestamp()).build();
pipeconfWatchdogService.addListener(pipeconfListener);
log.info("Started");
}
use of org.onlab.util.KryoNamespace in project dhcpl2relay by opencord.
the class DhcpL2Relay method activate.
@Activate
protected void activate(ComponentContext context) {
// start the dhcp relay agent
appId = coreService.registerApplication(DHCP_L2RELAY_APP);
componentConfigService.registerProperties(getClass());
eventDispatcher.addSink(DhcpL2RelayEvent.class, listenerRegistry);
KryoNamespace serializer = KryoNamespace.newBuilder().register(KryoNamespaces.API).register(Instant.class).register(DHCP.MsgType.class).register(DhcpAllocationInfo.class).build();
allocations = storageService.<String, DhcpAllocationInfo>consistentMapBuilder().withName("dhcpl2relay-allocations").withSerializer(Serializer.using(serializer)).withApplicationId(appId).build();
dhcpL2RelayCounters.setDelegate(delegate);
eventHandlerExecutor = newSingleThreadExecutor(groupedThreads("onos/dhcp", "dhcp-event-%d", log));
cfgService.addListener(cfgListener);
mastershipService.addListener(changeListener);
deviceService.addListener(deviceListener);
if (sadisService != null) {
subsService = sadisService.getSubscriberInfoService();
} else {
log.warn(SADIS_NOT_RUNNING);
}
factories.forEach(cfgService::registerConfigFactory);
// update the dhcp server configuration.
updateConfig();
if (context != null) {
modified(context);
}
// add the packet services.
packetService.addProcessor(dhcpRelayPacketProcessor, PacketProcessor.director(0));
log.info("DHCP-L2-RELAY Started");
}
Aggregations