long start = System.currentTimeMillis();
// Create our extension point registry
registry = new DefaultExtensionPointRegistry();
UtilityExtensionPoint utilities = new DefaultUtilityExtensionPoint(registry);
registry.addExtensionPoint(utilities);
// Get work scheduler
workScheduler = utilities.getUtility(WorkScheduler.class);
// Create an interface contract mapper
InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
// Get factory extension point
ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint();
registry.addExtensionPoint(factories);
// Get Message factory
MessageFactory messageFactory = factories.getFactory(MessageFactory.class);
// Get proxy factory
ProxyFactoryExtensionPoint proxyFactories = registry.getExtensionPoint(ProxyFactoryExtensionPoint.class);
proxyFactory = new ExtensibleProxyFactory(proxyFactories);
// Create model factories
assemblyFactory = new RuntimeAssemblyFactory();
factories.addFactory(assemblyFactory);
PolicyFactory policyFactory = new DefaultPolicyFactory();
factories.addFactory(policyFactory);
// Load the runtime modules
modules = loadModules(registry);
// Start the runtime modules
startModules(registry, modules);
SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
IntentAttachPointTypeFactory intentAttachPointTypeFactory = new DefaultIntentAttachPointTypeFactory();
factories.addFactory(intentAttachPointTypeFactory);
ContributionFactory contributionFactory = factories.getFactory(ContributionFactory.class);
// Create a monitor
MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
if (monitorFactory != null){
monitor = monitorFactory.createMonitor();
} else {
monitorFactory = new DefaultMonitorFactoryImpl();
monitor = monitorFactory.createMonitor();
utilities.addUtility(monitorFactory);
//logger.fine("No MonitorFactory is found on the classpath.");
}
// Create a contribution service
policyDefinitions = new ArrayList<SCADefinitions>();