Search in sources :

Example 6 with PluginManagerService

use of com.alipay.sofa.ark.spi.service.plugin.PluginManagerService in project sofa-ark by alipay.

the class BizClassloaderTest method before.

@Before
public void before() {
    ArkServiceContainer arkServiceContainer = new ArkServiceContainer();
    arkServiceContainer.start();
    pluginManagerService = ArkServiceContainerHolder.getContainer().getService(PluginManagerService.class);
    pluginDeployService = ArkServiceContainerHolder.getContainer().getService(PluginDeployService.class);
    classloaderService = ArkServiceContainerHolder.getContainer().getService(ClassloaderService.class);
    bizManagerService = ArkServiceContainerHolder.getContainer().getService(BizManagerService.class);
}
Also used : PluginManagerService(com.alipay.sofa.ark.spi.service.plugin.PluginManagerService) PluginDeployService(com.alipay.sofa.ark.spi.service.plugin.PluginDeployService) ClassloaderService(com.alipay.sofa.ark.spi.service.classloader.ClassloaderService) BizManagerService(com.alipay.sofa.ark.spi.service.biz.BizManagerService) ArkServiceContainer(com.alipay.sofa.ark.container.service.ArkServiceContainer) Before(org.junit.Before)

Example 7 with PluginManagerService

use of com.alipay.sofa.ark.spi.service.plugin.PluginManagerService in project sofa-ark by alipay.

the class RegistryServiceTest method before.

@Before
public void before() {
    ArkServiceContainer arkServiceContainer = new ArkServiceContainer();
    arkServiceContainer.start();
    registryService = ArkServiceContainerHolder.getContainer().getService(RegistryService.class);
    pluginManagerService = ArkServiceContainerHolder.getContainer().getService(PluginManagerService.class);
    pluginDeployService = ArkServiceContainerHolder.getContainer().getService(PluginDeployService.class);
    classloaderService = ArkServiceContainerHolder.getContainer().getService(ClassloaderService.class);
}
Also used : PluginManagerService(com.alipay.sofa.ark.spi.service.plugin.PluginManagerService) PluginDeployService(com.alipay.sofa.ark.spi.service.plugin.PluginDeployService) RegistryService(com.alipay.sofa.ark.spi.service.registry.RegistryService) ClassloaderService(com.alipay.sofa.ark.spi.service.classloader.ClassloaderService) ArkServiceContainer(com.alipay.sofa.ark.container.service.ArkServiceContainer) Before(org.junit.Before)

Example 8 with PluginManagerService

use of com.alipay.sofa.ark.spi.service.plugin.PluginManagerService in project sofa-ark by alipay.

the class ExtensionServiceTest method testNotExtensibleService.

@Test
public void testNotExtensibleService() {
    PluginManagerService pluginManagerService = ArkServiceContainerHolder.getContainer().getService(PluginManagerService.class);
    PluginModel pluginModel = new PluginModel().setPluginClassLoader(this.getClass().getClassLoader()).setPluginName("mock-plugin");
    pluginManagerService.registerPlugin(pluginModel);
    try {
        ArkServiceLoader.loadExtensionFromArkPlugin(ServiceC.class, "", "mock-plugin");
    } catch (ArkRuntimeException ex) {
        Assert.assertTrue(ex.getMessage().contains(String.format("is not annotated by %s.", Extensible.class)));
    }
}
Also used : PluginManagerService(com.alipay.sofa.ark.spi.service.plugin.PluginManagerService) PluginModel(com.alipay.sofa.ark.container.model.PluginModel) Extensible(com.alipay.sofa.ark.spi.service.extension.Extensible) ArkRuntimeException(com.alipay.sofa.ark.exception.ArkRuntimeException) ArkContainerTest(com.alipay.sofa.ark.container.ArkContainerTest) Test(org.junit.Test) BaseTest(com.alipay.sofa.ark.container.BaseTest)

Aggregations

PluginManagerService (com.alipay.sofa.ark.spi.service.plugin.PluginManagerService)8 PluginModel (com.alipay.sofa.ark.container.model.PluginModel)5 ArkContainerTest (com.alipay.sofa.ark.container.ArkContainerTest)4 BaseTest (com.alipay.sofa.ark.container.BaseTest)4 Test (org.junit.Test)4 ArkServiceContainer (com.alipay.sofa.ark.container.service.ArkServiceContainer)3 ArkRuntimeException (com.alipay.sofa.ark.exception.ArkRuntimeException)3 ClassloaderService (com.alipay.sofa.ark.spi.service.classloader.ClassloaderService)3 PluginDeployService (com.alipay.sofa.ark.spi.service.plugin.PluginDeployService)3 Before (org.junit.Before)3 ServiceB (com.alipay.sofa.ark.container.service.extension.spi.ServiceB)1 ServiceBImpl3 (com.alipay.sofa.ark.container.service.extension.spi.impl.ServiceBImpl3)1 ServiceBImpl4 (com.alipay.sofa.ark.container.service.extension.spi.impl.ServiceBImpl4)1 Plugin (com.alipay.sofa.ark.spi.model.Plugin)1 BizManagerService (com.alipay.sofa.ark.spi.service.biz.BizManagerService)1 Extensible (com.alipay.sofa.ark.spi.service.extension.Extensible)1 Extension (com.alipay.sofa.ark.spi.service.extension.Extension)1 RegistryService (com.alipay.sofa.ark.spi.service.registry.RegistryService)1