private synchronized String getInstanceID() { // make sure the instanceID has not reached the max if (instanceID == Long.MAX_VALUE) instanceID = 0; // create a unique instance id return getApplicationId() + "." + instanceID++; //$NON-NLS-1$ } }
private synchronized String getInstanceID() { // make sure the instanceID has not reached the max if (instanceID == Long.MAX_VALUE) instanceID = 0; // create a unique instance id return getApplicationId() + "." + instanceID++; //$NON-NLS-1$ } }
private synchronized String getInstanceID() { // make sure the instanceID has not reached the max if (instanceID == Long.MAX_VALUE) instanceID = 0; // create a unique instance id return getApplicationId() + "." + instanceID++; //$NON-NLS-1$ } }
Hashtable getServiceProperties() { Hashtable props = new Hashtable(10); props.put(ApplicationDescriptor.APPLICATION_PID, getApplicationId()); if (name != null) props.put(ApplicationDescriptor.APPLICATION_NAME, name); props.put(ApplicationDescriptor.APPLICATION_CONTAINER, Activator.PI_APP); props.put(ApplicationDescriptor.APPLICATION_LOCATION, getLocation()); Boolean launchable = appContainer.isLocked(this) == 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_LAUNCHABLE, launchable); props.put(ApplicationDescriptor.APPLICATION_LOCKED, getLocked()); Boolean visible = (flags & FLAG_VISIBLE) != 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_VISIBLE, visible); props.put(APP_TYPE, getThreadTypeString()); if ((flags & FLAG_DEFAULT_APP) != 0) props.put(APP_DEFAULT, Boolean.TRUE); if (iconURL != null) props.put(ApplicationDescriptor.APPLICATION_ICON, iconURL); return props; }
Hashtable getServiceProperties() { Hashtable props = new Hashtable(10); props.put(ApplicationDescriptor.APPLICATION_PID, getApplicationId()); if (name != null) props.put(ApplicationDescriptor.APPLICATION_NAME, name); props.put(ApplicationDescriptor.APPLICATION_CONTAINER, Activator.PI_APP); props.put(ApplicationDescriptor.APPLICATION_LOCATION, getLocation()); Boolean launchable = appContainer.isLocked(this) == 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_LAUNCHABLE, launchable); props.put(ApplicationDescriptor.APPLICATION_LOCKED, getLocked()); Boolean visible = (flags & FLAG_VISIBLE) != 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_VISIBLE, visible); props.put(APP_TYPE, getThreadTypeString()); if ((flags & FLAG_DEFAULT_APP) != 0) props.put(APP_DEFAULT, Boolean.TRUE); if (iconURL != null) props.put(ApplicationDescriptor.APPLICATION_ICON, iconURL); return props; }
Hashtable getServiceProperties() { Hashtable props = new Hashtable(10); props.put(ApplicationDescriptor.APPLICATION_PID, getApplicationId()); if (name != null) props.put(ApplicationDescriptor.APPLICATION_NAME, name); props.put(ApplicationDescriptor.APPLICATION_CONTAINER, Activator.PI_APP); props.put(ApplicationDescriptor.APPLICATION_LOCATION, getLocation()); Boolean launchable = appContainer.isLocked(this) == 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_LAUNCHABLE, launchable); props.put(ApplicationDescriptor.APPLICATION_LOCKED, getLocked()); Boolean visible = (flags & FLAG_VISIBLE) != 0 ? Boolean.TRUE : Boolean.FALSE; props.put(ApplicationDescriptor.APPLICATION_VISIBLE, visible); props.put(APP_TYPE, getThreadTypeString()); if ((flags & FLAG_DEFAULT_APP) != 0) props.put(APP_DEFAULT, Boolean.TRUE); if (iconURL != null) props.put(ApplicationDescriptor.APPLICATION_ICON, iconURL); return props; }
void unlock(EclipseAppHandle appHandle) { synchronized (lock) { if (activeGlobalSingleton == appHandle) activeGlobalSingleton = null; else if (activeScopedSingleton == appHandle) activeScopedSingleton = null; else if (((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getCardinalityType() == EclipseAppDescriptor.FLAG_CARD_LIMITED) { if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getApplicationId()); if (limited != null) limited.remove(appHandle); } } if (activeMain == appHandle) activeMain = null; if (activeHandles.remove(appHandle)) refreshAppDescriptors(); // only refresh descriptors if we really unlocked something } }
void unlock(EclipseAppHandle appHandle) { synchronized (lock) { if (activeGlobalSingleton == appHandle) activeGlobalSingleton = null; else if (activeScopedSingleton == appHandle) activeScopedSingleton = null; else if (((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getCardinalityType() == EclipseAppDescriptor.FLAG_CARD_LIMITED) { if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getApplicationId()); if (limited != null) limited.remove(appHandle); } } if (activeMain == appHandle) activeMain = null; if (activeHandles.remove(appHandle)) refreshAppDescriptors(); // only refresh descriptors if we really unlocked something } }
void unlock(EclipseAppHandle appHandle) { synchronized (lock) { if (activeGlobalSingleton == appHandle) activeGlobalSingleton = null; else if (activeScopedSingleton == appHandle) activeScopedSingleton = null; else if (((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getCardinalityType() == EclipseAppDescriptor.FLAG_CARD_LIMITED) { if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(((EclipseAppDescriptor) appHandle.getApplicationDescriptor()).getApplicationId()); if (limited != null) limited.remove(appHandle); } } if (activeMain == appHandle) activeMain = null; if (activeHandles.remove(appHandle)) refreshAppDescriptors(); // only refresh descriptors if we really unlocked something } }
int isLocked(EclipseAppDescriptor eclipseApp) { synchronized (lock) { if (activeGlobalSingleton != null) return LOCKED_SINGLETON_GLOBAL_RUNNING; switch (eclipseApp.getCardinalityType()) { case EclipseAppDescriptor.FLAG_CARD_SINGLETON_GLOGAL : if (activeHandles.size() > 0) return LOCKED_SINGLETON_GLOBAL_APPS_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_SINGLETON_SCOPED : if (activeScopedSingleton != null) return LOCKED_SINGLETON_SCOPED_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_LIMITED : if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited != null && limited.size() >= eclipseApp.getCardinality()) return LOCKED_SINGLETON_LIMITED_RUNNING; } break; case EclipseAppDescriptor.FLAG_CARD_UNLIMITED : break; default : break; } if (eclipseApp.getThreadType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD && activeMain != null) return LOCKED_MAIN_THREAD_RUNNING; return NOT_LOCKED; } }
int isLocked(EclipseAppDescriptor eclipseApp) { synchronized (lock) { if (activeGlobalSingleton != null) return LOCKED_SINGLETON_GLOBAL_RUNNING; switch (eclipseApp.getCardinalityType()) { case EclipseAppDescriptor.FLAG_CARD_SINGLETON_GLOGAL : if (activeHandles.size() > 0) return LOCKED_SINGLETON_GLOBAL_APPS_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_SINGLETON_SCOPED : if (activeScopedSingleton != null) return LOCKED_SINGLETON_SCOPED_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_LIMITED : if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited != null && limited.size() >= eclipseApp.getCardinality()) return LOCKED_SINGLETON_LIMITED_RUNNING; } break; case EclipseAppDescriptor.FLAG_CARD_UNLIMITED : break; default : break; } if (eclipseApp.getThreadType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD && activeMain != null) return LOCKED_MAIN_THREAD_RUNNING; return NOT_LOCKED; } }
int isLocked(EclipseAppDescriptor eclipseApp) { synchronized (lock) { if (activeGlobalSingleton != null) return LOCKED_SINGLETON_GLOBAL_RUNNING; switch (eclipseApp.getCardinalityType()) { case EclipseAppDescriptor.FLAG_CARD_SINGLETON_GLOGAL : if (activeHandles.size() > 0) return LOCKED_SINGLETON_GLOBAL_APPS_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_SINGLETON_SCOPED : if (activeScopedSingleton != null) return LOCKED_SINGLETON_SCOPED_RUNNING; break; case EclipseAppDescriptor.FLAG_CARD_LIMITED : if (activeLimited != null) { ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited != null && limited.size() >= eclipseApp.getCardinality()) return LOCKED_SINGLETON_LIMITED_RUNNING; } break; case EclipseAppDescriptor.FLAG_CARD_UNLIMITED : break; default : break; } if (eclipseApp.getThreadType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD && activeMain != null) return LOCKED_MAIN_THREAD_RUNNING; return NOT_LOCKED; } }
throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.singleton_running, activeScopedSingleton.getInstanceId())); case LOCKED_SINGLETON_LIMITED_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.max_running, eclipseApp.getApplicationId())); case LOCKED_MAIN_THREAD_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.main_running, activeMain.getInstanceId())); if (activeLimited == null) activeLimited = new HashMap(3); ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited == null) { limited = new ArrayList(eclipseApp.getCardinality()); activeLimited.put(eclipseApp.getApplicationId(), limited);
throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.singleton_running, activeScopedSingleton.getInstanceId())); case LOCKED_SINGLETON_LIMITED_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.max_running, eclipseApp.getApplicationId())); case LOCKED_MAIN_THREAD_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.main_running, activeMain.getInstanceId())); if (activeLimited == null) activeLimited = new HashMap(3); ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited == null) { limited = new ArrayList(eclipseApp.getCardinality()); activeLimited.put(eclipseApp.getApplicationId(), limited);
throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.singleton_running, activeScopedSingleton.getInstanceId())); case LOCKED_SINGLETON_LIMITED_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.max_running, eclipseApp.getApplicationId())); case LOCKED_MAIN_THREAD_RUNNING : throw new ApplicationException(ApplicationException.APPLICATION_NOT_LAUNCHABLE, NLS.bind(Messages.main_running, activeMain.getInstanceId())); if (activeLimited == null) activeLimited = new HashMap(3); ArrayList limited = (ArrayList) activeLimited.get(eclipseApp.getApplicationId()); if (limited == null) { limited = new ArrayList(eclipseApp.getCardinality()); activeLimited.put(eclipseApp.getApplicationId(), limited);