本文整理汇总了Java中org.hawk.osgiserver.HManager类的典型用法代码示例。如果您正苦于以下问题:Java HManager类的具体用法?Java HManager怎么用?Java HManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HManager类属于org.hawk.osgiserver包,在下文中一共展示了HManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stop
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
HManager.getInstance().stopAllRunningInstances(
ShutdownRequestType.ONLY_LOCAL);
if (artemis != null) {
artemis.stop();
artemis = null;
}
if (tcpServer != null) {
tcpServer.stop();
tcpServer = null;
}
}
示例2: stop
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
HManager.getInstance().stopAllRunningInstances(
ShutdownRequestType.ONLY_LOCAL);
if (artemis != null) {
artemis.stop();
artemis = null;
}
if (tcpServer != null) {
tcpServer.stop();
tcpServer = null;
}
}
示例3: HawkServerConfigurator
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
public HawkServerConfigurator(Iface iface) {
this.iface = iface;
hawkInstanceConfigs = new ArrayList<HawkInstanceConfig>();
manager = HManager.getInstance();
parser = new ConfigFileParser();
numberOfConfiguredInstances = 0;
}
示例4: getHawkByName
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private HModel getHawkByName(String name) throws HawkInstanceNotFound {
final HModel model = HManager.getInstance().getHawkByName(name);
if (model == null) {
throw new HawkInstanceNotFound();
}
return model;
}
示例5: createInstance
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void createInstance(String name, String backend, int minDelay, int maxDelay, List<String> plugins) throws TException {
try {
final HManager manager = HManager.getInstance();
if (manager.getHawkByName(name) == null) {
HModel model = HModel.create(new LocalHawkFactory(), name, storageFolder(name),
null, backend, plugins,
manager, new SecurePreferencesCredentialsStore(), minDelay, maxDelay);
addStateListener(model);
}
} catch (Exception ex) {
throw new TException(ex);
}
}
示例6: listInstances
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<HawkInstance> listInstances() throws TException {
final List<HawkInstance> instances = new ArrayList<>();
for (HModel m : HManager.getInstance().getHawks()) {
final HawkInstance instance = new HawkInstance();
instance.name = m.getName();
instance.state = ArtemisProducerStateListener.mapHawkStateToThrift(m.getStatus());
instance.message = m.getInfo();
instances.add(instance);
}
return instances;
}
示例7: removeInstance
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void removeInstance(String name) throws HawkInstanceNotFound, TException {
final HModel model = getHawkByName(name);
try {
HManager.getInstance().delete(model, true);
removeStateListener(model);
} catch (BackingStoreException e) {
throw new TException(e.getMessage(), e);
}
}
示例8: startInstance
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void startInstance(String name) throws HawkInstanceNotFound, TException {
final HModel model = getHawkByName(name);
if (!model.isRunning()) {
model.start(HManager.getInstance());
addStateListener(model);
}
}
示例9: connectToArtemis
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
protected void connectToArtemis() {
if (consumer != null && consumer.isSessionOpen()) {
return;
}
try {
HawkState currentState = HawkState.RUNNING;
String currentInfo = "";
for (HawkInstance instance : client.listInstances()) {
if (name.equals(instance.getName())) {
currentState = instance.getState();
currentInfo = instance.getMessage();
}
}
org.hawk.core.ICredentialsStore.Credentials creds = HManager.getInstance().getCredentialsStore().get(location);
Subscription subState = client.watchStateChanges(name);
consumer = APIUtils.connectToArtemis(subState, SubscriptionDurability.TEMPORARY);
if (creds != null) {
consumer.openSession(creds.getUsername(), creds.getPassword());
} else {
consumer.openSession(null, null);
}
consumer.processChangesAsync(new StatePropagationConsumer(currentState, currentInfo));
} catch (HawkInstanceNotFound nf) {
/*
* Not found yet: this is probably because of a call from the
* constructor right before invoking init. This is normal: we
* will simply try again once init has invoked createInstance.
*/
} catch (Exception e) {
Activator.logError(e);
}
}
示例10: setup
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@BeforeClass
static public void setup() {
initConfigurationFolder();
setupAndCopyPathsInXmlFile(xmlFileName_1);
setupAndCopyPathsInXmlFile(xmlFileName_2);
manager = HManager.getInstance();
hawkIface = new HawkThriftIface(ThriftProtocol.TUPLE, null, null);
serverConfigurator = new HawkServerConfigurator(hawkIface);
serverConfigurator.loadHawkServerConfigurations();
}
示例11: getHawkNames
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private String[] getHawkNames() {
final HManager hManager = HUIManager.getInstance();
final Set<HModel> hawks = hManager.getHawks();
final List<String> hawkNames = new ArrayList<String>();
for (HModel hawk : hawks) {
if (hawk.getGraph() != null) {
hawkNames.add(hawk.getName());
}
}
Collections.sort(hawkNames);
final String[] arrHawkNames = hawkNames.toArray(new String[hawkNames.size()]);
return arrHawkNames;
}
示例12: listRepositoryTypes
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listRepositoryTypes() {
return new ArrayList<String>(HManager.getInstance().getVCSTypes());
}
示例13: listPlugins
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listPlugins() throws TException {
return HManager.getInstance().getAvailablePlugins();
}
示例14: listBackends
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listBackends() throws TException {
return new ArrayList<>(HManager.getInstance().getIndexTypes());
}
示例15: checkConnected
import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private void checkConnected() {
if (hawkManager == null) {
hawkManager = HManager.getInstance();
}
}