当前位置: 首页>>代码示例>>Java>>正文


Java Deployer类代码示例

本文整理汇总了Java中org.ow2.chameleon.core.services.Deployer的典型用法代码示例。如果您正苦于以下问题:Java Deployer类的具体用法?Java Deployer怎么用?Java Deployer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Deployer类属于org.ow2.chameleon.core.services包,在下文中一共展示了Deployer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testWatcherAndDeployerRegistration

import org.ow2.chameleon.core.services.Deployer; //导入依赖的package包/类
@Test
public void testWatcherAndDeployerRegistration() {
    System.setProperty(ApplicationConfigurationImpl.APPLICATION_CONFIGURATION, "target/test-classes/conf/regular.conf");
    BundleContext context = mock(BundleContext.class);
    ServiceRegistration reg = mock(ServiceRegistration.class);
    ServiceRegistration regForConf = mock(ServiceRegistration.class);
    when(context.registerService(eq(Deployer.class), any(Deployer.class), any(Dictionary.class))).thenReturn(reg);
    when(context.registerService(eq(Configuration.class), any(Configuration.class), any(Dictionary.class)))
            .thenReturn(regForConf);
    Watcher watcher = mock(Watcher.class);
    ApplicationConfigurationImpl configuration = new ApplicationConfigurationImpl(null, context);
    configuration.watcher = watcher;
    configuration.manageWatcher(context);
    configuration.start();
    verify(watcher, times(1)).add(any(File.class), anyBoolean());
    verify(context, times(1)).registerService(eq(Deployer.class), any(Deployer.class), any(Dictionary.class));
    configuration.stop();
    verify(watcher, times(1)).removeAndStopIfNeeded(any(File.class));
    verify(reg, times(1)).unregister();
    verify(regForConf, times(5)).unregister();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:22,代码来源:ApplicationConfigurationTest.java

示例2: manageWatcher

import org.ow2.chameleon.core.services.Deployer; //导入依赖的package包/类
protected void manageWatcher(BundleContext context) {
    if (context != null && (isDev() || getBooleanWithDefault("application.watch-configuration", false))
            && watcher != null) {
        LOGGER.info("Enabling the watching of the configuration file");
        watcher.add(configFile.getParentFile(), true);
        registration = context.registerService(Deployer.class, new ConfigurationDeployer(), null);
    }
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:9,代码来源:ApplicationConfigurationImpl.java

示例3: testStartStop

import org.ow2.chameleon.core.services.Deployer; //导入依赖的package包/类
@Test
public void testStartStop() {
    BundleContext context = mock(BundleContext.class);
    Bundle bundle = mock(Bundle.class);
    ServiceRegistration<Deployer> reg = mock(ServiceRegistration.class);
    dir = new File("target/junk/webjars");
    when(bundle.getDataFile("webjars")).thenReturn(dir);
    when(context.getBundle()).thenReturn(bundle);
    WebJarController controller = mock(WebJarController.class);
    WebJarDeployer deployer = new WebJarDeployer(context, controller);
    when(context.registerService(Deployer.class, deployer, null)).thenReturn(reg);

    deployer.start();
    deployer.stop();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:16,代码来源:WebJarDeployerTest.java

示例4: start

import org.ow2.chameleon.core.services.Deployer; //导入依赖的package包/类
/**
 * Registers the deployer service.
 */
public synchronized void start() {
    reg = context.registerService(Deployer.class, this, null);
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:7,代码来源:WebJarDeployer.java


注:本文中的org.ow2.chameleon.core.services.Deployer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。