org.ogema.core.application.ApplicationManager.getAppID()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.ogema.core.application.ApplicationManager.getAppID()方法的一些代码示例,展示了ApplicationManager.getAppID()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationManager.getAppID()方法的具体详情如下:
包路径:org.ogema.core.application.ApplicationManager
类名称:ApplicationManager
方法名:getAppID

ApplicationManager.getAppID介绍

暂无

代码示例

代码示例来源:origin: org.ogema.ref-impl/resource-manager

public TransactionImpl(ResourceDBManager dbMan, ApplicationManager appMan) {
  m_dbMan = dbMan;
  m_appMan = appMan;
  m_logger = org.slf4j.LoggerFactory.getLogger("Transaction-" + appMan.getAppID());
}

代码示例来源:origin: org.ogema.widgets/ogema-js-bundle

@Override
public void sendMessage(ApplicationManager am, Message message)	throws RejectedExecutionException, IllegalStateException {
  sendMessage(Objects.requireNonNull(am).getAppID(), message);
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

protected final String getAppId() {
  return appMan.getAppID().getIDString();
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
@Deprecated
public String getUniqueResourceName(String appResourceName) {
  return dbMan.getUniqueResourceName(appResourceName, Long.toString(appMan.getAppID().getBundle().getBundleId()));
}

代码示例来源:origin: org.ogema.widgets/ogema-js-bundle

@Deprecated
  public WidgetAppImpl(String widgetAppId, String htmlPath, OgemaGuiService guiService, ApplicationManager am, boolean pageSpecificId) {
    Objects.requireNonNull(am);
    Objects.requireNonNull(guiService);
    Objects.requireNonNull(htmlPath);
    checkPath(htmlPath);
    this.guiService = guiService;
//        this.widgetAppId = widgetAppId;
    this.wam = am.getWebAccessManager();
    this.log = am.getLogger();
    this.appId = am.getAppID();
    this.htmlPath = htmlPath;
//        this.pageSpecificId = pageSpecificId;
//        this.sessions = null;
    this.appVersion = AccessController.doPrivileged(getVersion);
    getWidgetService().addApp(this);
  }

代码示例来源:origin: org.ogema.widgets/ogema-js-bundle

public WidgetAppImpl(String htmlPath, OgemaGuiService guiService, ApplicationManager am, boolean pageSpecificId) throws IllegalStateException {
    // we do this first, since it throws an exception if an app is already registered under the same url
    Objects.requireNonNull(am);
    Objects.requireNonNull(guiService);
    checkPath(htmlPath);
    this.guiService = guiService;
    this.wam = am.getWebAccessManager();
    this.log = am.getLogger();
    this.appId = am.getAppID();
    this.htmlPath = htmlPath;
//        this.pageSpecificId = pageSpecificId;
//        this.sessions = null;
    this.appVersion = AccessController.doPrivileged(getVersion);
    getWidgetService().addApp(this);
  }

代码示例来源:origin: org.ogema.tools/system-supervision

@Override
public void start(final ApplicationManager appManager) {
  this.appMan = appManager;
  appManager.getResourceAccess().addResourceDemand(SystemSupervisionConfig.class, this);
  this.shellInitial = new ShellCommandsInitial(appManager, appManager.getAppID().getBundle().getBundleContext());
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

protected void checkWriteAccess() throws SecurityException {
  if (getAccessMode() == READ_ONLY) {
    throw new ResourceAccessException(String.format(
        "Application %s does not currently have write access to resource %s", resMan
            .getApplicationManager().getAppID(), getPath()));
  }
}

代码示例来源:origin: org.ogema.tools/resource-manipulators

public ResourceManipulatorImpl(ApplicationManager applicationManager) {
    appMan = applicationManager;
    resMan = applicationManager.getResourceManagement();
    resAcc = applicationManager.getResourceAccess();
    logger = applicationManager.getLogger();
//        appId = applicationManager.getAppID().getIDString(); //this is not even invariant under restart with unchanged configuration
    Bundle bdl = applicationManager.getAppID().getBundle();
    appId = bdl.getSymbolicName();
  }

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public AdminApplication getApplication() {
  return appman.getAdministrationManager().getAppById(appman.getAppID().getIDString());
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public AdminApplication getApplication() {
  return app.getAdministrationManager().getAppById(app.getAppID().getIDString());
}

代码示例来源:origin: org.ogema.tools/system-supervision

@SuppressWarnings("unchecked")
@Descriptor("Get resources of a specified type.")
public List<Resource> getResources(
    @Descriptor("Resource type (full class name)")
    @Parameter(names= { "-t", "--type"}, absentValue = "")
    String type) {
  Class<? extends Resource> clazz = null;
  if (!type.isEmpty()) {
    clazz = loadResourceClass(appMan.getAppID().getBundle().getBundleContext(), type);
    if (clazz == null)
      return Collections.emptyList();
  }
  return (List<Resource>) appMan.getResourceAccess().getResources(clazz);
}

代码示例来源:origin: org.ogema.tools/system-supervision

@SuppressWarnings("unchecked")
@Descriptor("Get toplevel resources")
public List<Resource> toplevelResources(
    @Descriptor("Resource type (full class name)")
    @Parameter(names= { "-t", "--type"}, absentValue = "")
    String type) {
  Class<? extends Resource> clazz = null;
  if (!type.isEmpty()) {
    clazz = loadResourceClass(appMan.getAppID().getBundle().getBundleContext(), type);
    if (clazz == null)
      return Collections.emptyList();
  }
  return (List<Resource>) appMan.getResourceAccess().getToplevelResources(clazz);
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public AdminApplication getApplication() {
  ApplicationManager appman = origin.resMan.getApplicationManager();
  return appman.getAdministrationManager().getAppById(appman.getAppID().getIDString());
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public AdminApplication getApplication() {
  ApplicationManager appman = origin.resMan.getApplicationManager();
  return appman.getAdministrationManager().getAppById(appman.getAppID().getIDString());
}

代码示例来源:origin: org.ogema.tools/resource-manipulators

@Override
@Deprecated
public void start(ApplicationManager applicationManager) {
  appMan = applicationManager;
  resMan = applicationManager.getResourceManagement();
  resAcc = applicationManager.getResourceAccess();
  patAcc = applicationManager.getResourcePatternAccess();
  logger = applicationManager.getLogger();
  ownName = applicationManager.getAppID().getIDString();
  // add a pattern demand with "device specific": No one else should modify this, except perhaps an administrator who knows what he is doing.
  patAcc.addPatternDemand(patternClass, this, AccessPriority.PRIO_DEVICESPECIFIC);
}

代码示例来源:origin: org.ogema.tools/system-supervision

@Descriptor("Count the number of subresources for a specific resource")
public int nrSubresources(
    @Descriptor("Resource type (full class name)")
    @Parameter(names= { "-t", "--type"}, absentValue = "")
    String type,
    @Descriptor("Resource path") String path) {
  final Resource base = appMan.getResourceAccess().getResource(path);
  if (base == null) {
    System.out.println("Resource not found: " + path);
    return 0;
  }
  Class<? extends Resource> clazz = null;
  if (!type.isEmpty()) {
    clazz = loadResourceClass(appMan.getAppID().getBundle().getBundleContext(), type);
    if (clazz == null)
      return 0;
  }
  if (clazz == null)
    return base.getDirectSubResources(true).size();
  else {
    final AtomicInteger cnt = new AtomicInteger(0);
    countSubresources(base, clazz, cnt);
    return cnt.get();
  }
}

代码示例来源:origin: org.ogema.tools/system-supervision

private void startInternal() {
  final SystemSupervisionConfig config = activeConfig;
  if (config == null || !config.isActive()) {
    appMan.getLogger().error("Inactive configuration resource {}", config);
    return;
  }
  this.tasks = new Tasks(appMan, config);
  this.triggerListener = new TriggerListener(appMan, config, tasks);
  try {
    this.shellCommands = new ShellCommands(tasks, config, appMan.getAppID().getBundle().getBundleContext());
  } catch (NoClassDefFoundError e) {} // optional dependency
}

代码示例来源:origin: org.ogema.ref-impl/resource-manager

@Override
public AdminApplication getApplication() {
  return resman.getApplicationManager().getAdministrationManager().getAppById(resman.getApplicationManager().getAppID().getIDString());
}

代码示例来源:origin: org.ogema.tools/system-supervision

@Descriptor("Count the number of resources, optionally for a specific resource type")
public int nrResources(
    @Descriptor("Resource type (full class name)")
    @Parameter(names= { "-t", "--type"}, absentValue = "")
    String type,
    @Descriptor("Count only toplevel resources") 
    @Parameter(names = { "-top" }, absentValue = "false", presentValue="true") 
    boolean toplevelOnly
    ) {
  Class<? extends Resource> clazz = null;
  if (!type.isEmpty()) {
    clazz = loadResourceClass(appMan.getAppID().getBundle().getBundleContext(), type);
    if (clazz == null)
      return 0;
  }
  if (toplevelOnly)
    return appMan.getResourceAccess().getToplevelResources(clazz).size();
  else
    return appMan.getResourceAccess().getResources(clazz).size();
}

相关文章