ServiceReference getServiceReference() { ServiceRegistration reg = getServiceRegistration(); if (reg == null) return null; try { return reg.getReference(); } catch (IllegalStateException e) { return null; // this will happen if the service has been unregistered already } }
ServiceReference getServiceReference() { ServiceRegistration reg = getServiceRegistration(); if (reg == null) return null; try { return reg.getReference(); } catch (IllegalStateException e) { return null; // this will happen if the service has been unregistered already } }
ServiceReference getServiceReference() { ServiceRegistration reg = getServiceRegistration(); if (reg == null) return null; try { return reg.getReference(); } catch (IllegalStateException e) { return null; // this will happen if the service has been unregistered already } }
synchronized public String getState() { switch (status) { case FLAG_STARTING : return STARTING; case FLAG_ACTIVE : return ApplicationHandle.RUNNING; case FLAG_STOPPING : return ApplicationHandle.STOPPING; case FLAG_STOPPED : default : // must only check this if the status is STOPPED; otherwise we throw exceptions before we have set the registration. if (getServiceRegistration() == null) throw new IllegalStateException(NLS.bind(Messages.application_error_state_stopped, getInstanceId())); return STOPPED; } }
synchronized public String getState() { switch (status) { case FLAG_STARTING : return STARTING; case FLAG_ACTIVE : return ApplicationHandle.RUNNING; case FLAG_STOPPING : return ApplicationHandle.STOPPING; case FLAG_STOPPED : default : // must only check this if the status is STOPPED; otherwise we throw exceptions before we have set the registration. if (getServiceRegistration() == null) throw new IllegalStateException(NLS.bind(Messages.application_error_state_stopped, getInstanceId())); return STOPPED; } }
@Override synchronized public String getState() { switch (status) { case FLAG_STARTING : return STARTING; case FLAG_ACTIVE : return ApplicationHandle.RUNNING; case FLAG_STOPPING : return ApplicationHandle.STOPPING; case FLAG_STOPPED : default : // must only check this if the status is STOPPED; otherwise we throw exceptions before we have set the registration. if (getServiceRegistration() == null) throw new IllegalStateException(NLS.bind(Messages.application_error_state_stopped, getInstanceId())); return STOPPED; } }
private synchronized void setAppStatus(int status) { if (this.status == status) return; if ((status & EclipseAppHandle.FLAG_STARTING) != 0) throw new IllegalArgumentException("Cannot set app status to starting"); //$NON-NLS-1$ // if status is stopping and the context is already stopping then return if ((status & EclipseAppHandle.FLAG_STOPPING) != 0) if ((this.status & (EclipseAppHandle.FLAG_STOPPING | EclipseAppHandle.FLAG_STOPPED)) != 0) return; // change the service properties to reflect the state change. this.status = status; ServiceRegistration handleReg = getServiceRegistration(); if (handleReg == null) return; handleReg.setProperties(getServiceProperties()); // if the status is stopped then unregister the service if ((this.status & EclipseAppHandle.FLAG_STOPPED) != 0) { ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().unlock(this); handleReg.unregister(); setServiceRegistration(null); } }
private synchronized void setAppStatus(int status) { if (this.status == status) return; if ((status & EclipseAppHandle.FLAG_STARTING) != 0) throw new IllegalArgumentException("Cannot set app status to starting"); //$NON-NLS-1$ // if status is stopping and the context is already stopping then return if ((status & EclipseAppHandle.FLAG_STOPPING) != 0) if ((this.status & (EclipseAppHandle.FLAG_STOPPING | EclipseAppHandle.FLAG_STOPPED)) != 0) return; // change the service properties to reflect the state change. this.status = status; ServiceRegistration handleReg = getServiceRegistration(); if (handleReg == null) return; handleReg.setProperties(getServiceProperties()); // if the status is stopped then unregister the service if ((this.status & EclipseAppHandle.FLAG_STOPPED) != 0) { ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().unlock(this); handleReg.unregister(); setServiceRegistration(null); } }
private synchronized void setAppStatus(int status) { if (this.status == status) return; if ((status & EclipseAppHandle.FLAG_STARTING) != 0) throw new IllegalArgumentException("Cannot set app status to starting"); //$NON-NLS-1$ // if status is stopping and the context is already stopping then return if ((status & EclipseAppHandle.FLAG_STOPPING) != 0) if ((this.status & (EclipseAppHandle.FLAG_STOPPING | EclipseAppHandle.FLAG_STOPPED)) != 0) return; // change the service properties to reflect the state change. this.status = status; ServiceRegistration handleReg = getServiceRegistration(); if (handleReg == null) return; handleReg.setProperties(getServiceProperties()); // if the status is stopped then unregister the service if ((this.status & EclipseAppHandle.FLAG_STOPPED) != 0) { ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().unlock(this); handleReg.unregister(); setServiceRegistration(null); } }