本文整理汇总了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();
}
示例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);
}
}
示例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();
}
示例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);
}