@Override public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (extensionPoint.equals(SERVICES_EXT_KEY)) { resourcesRegistry.doRegisterResource((ServiceDescriptor) contribution); } else if (extensionPoint.equals(FACTORIES_EXT_KEY)) { factoriesRegistry.doRegisterFactory((ResourceFactoryDescriptor) contribution); } else if (extensionPoint.equals(SHORTCUTS_EXT_KEY)) { shortcutsRegistry.doRegisterShortcut((ShortcutDescriptor) contribution); } }
@Override public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) { if (extensionPoint.equals(SERVICES_EXT_KEY)) { resourcesRegistry.doUnregisterResource((ServiceDescriptor) contribution); } else if (extensionPoint.equals(FACTORIES_EXT_KEY)) { factoriesRegistry.doUnregisterFactory((ResourceFactoryDescriptor) contribution); } else if (extensionPoint.equals(SHORTCUTS_EXT_KEY)) { shortcutsRegistry.doUnregisterShortcut((ShortcutDescriptor) contribution); } }
protected void doUnregisterResource(ServiceDescriptor descriptor) { ObjectName objectName = doResolveServiceName(descriptor); doUnregisterResource(objectName); String shortName = descriptor.getName(); if (StringUtils.isNotEmpty(shortName)) { shortcutsRegistry.unregisterShortcut(shortName); } }
public void registerShortcut(String shortName, String qualifiedName) { shortcutsRegistry.doRegisterShortcut(shortName, qualifiedName); }
public void unregisterShortcut(String name) { doUnregisterShortcut(name); } }
protected void doRegisterShortcut(ShortcutDescriptor descriptor) { doRegisterShortcut(descriptor.getShortName(), descriptor.getQualifiedName()); }
public void unregisterShortcut(String shortName) { shortcutsRegistry.doUnregisterShortcut(shortName); }
protected void doUnregisterShortcut(ShortcutDescriptor descriptor) { doUnregisterShortcut(descriptor.getShortName()); }
@Override public void registerResource(String shortName, String qualifiedName, Class<?> managementClass, Object instance) { resourcesRegistry.doRegisterResource(qualifiedName, managementClass, instance); if (shortName != null) { shortcutsRegistry.doRegisterShortcut(shortName, qualifiedName); } }
protected void doRegisterResource(ServiceDescriptor descriptor) { Resource resource = doResolveServiceDescriptor(descriptor); doRegisterResource(resource); String shortName = descriptor.getName(); if (StringUtils.isNotEmpty(shortName)) { shortcutsRegistry.doRegisterShortcut(shortName, resource.getManagementName()); } }
@Override public void unregisterResource(String shortName, String qualifiedName) { resourcesRegistry.doUnregisterResource(qualifiedName); if (shortName != null) { shortcutsRegistry.doUnregisterShortcut(shortName); } }