/** * This contructor should be used when creating * {@code ApplicationAdminPermission} instance for {@code checkPermission} * call. * * @param application the tareget of the operation, it must not be * {@code null} * @param actions the required operation. it must not be {@code null} * @throws NullPointerException if any of the arguments is null. */ public ApplicationAdminPermission(ApplicationDescriptor application, String actions) { super(application.getApplicationId()); if (application == null || actions == null) throw new NullPointerException("ApplicationDescriptor and action string cannot be null!"); this.filter = application.getApplicationId(); this.applicationDescriptor = application; this.actions = actions; init(); }
return false; /* it cannot be, this might be a bug */ if (!other.applicationID.equals(other.applicationDescriptor.getApplicationId())) return false; } else { Hashtable props = new Hashtable(); props.put("pid", other.applicationDescriptor.getApplicationId()); props.put("signer", new SignerWrapper(other.applicationDescriptor));
/** * This contructor should be used when creating <code>ApplicationAdminPermission</code> * instance for <code>checkPermission</code> call. * @param application the tareget of the operation, it must not be <code>null</code> * @param actions the required operation. it must not be <code>null</code> * @throws NullPointerException if any of the arguments is null. */ public ApplicationAdminPermission(ApplicationDescriptor application, String actions) { super(application.getApplicationId()); if( application == null || actions == null ) throw new NullPointerException( "ApplicationDescriptor and action string cannot be null!" ); this.filter = application.getApplicationId(); this.applicationDescriptor = application; this.actions = actions; init(); }
return false; /* it cannot be, this might be a bug */ if( !other.applicationID.equals( other.applicationDescriptor.getApplicationId() ) ) return false; props.put( "pid", other.applicationDescriptor.getApplicationId() ); props.put( "signer", new SignerWrapper( other.applicationDescriptor ) );
/** * Used by {@link ApplicationDescriptor} to determine if an application is locked. * @param desc the application descriptor * @return true if the application is persistently locked. */ public static boolean isLocked(ApplicationDescriptor desc) { synchronized (locks) { return locks.contains(desc.getApplicationId()); } }
/** * Used by {@link ApplicationDescriptor} to determine if an application is locked. * @param desc the application descriptor * @return true if the application is persistently locked. */ public static boolean isLocked(ApplicationDescriptor desc) { synchronized (locks) { return locks.contains(desc.getApplicationId()); } }
/** * Used by {@link ApplicationDescriptor} to determine if an application is locked. * @param desc the application descriptor * @return true if the application is persistently locked. */ public static boolean isLocked(ApplicationDescriptor desc) { synchronized (locks) { return locks.contains(desc.getApplicationId()); } }
/** * This contructor should be used when creating {@code ApplicationAdminPermission} * instance for {@code checkPermission} call. * @param application the tareget of the operation, it must not be {@code null} * @param actions the required operation. it must not be {@code null} * @throws NullPointerException if any of the arguments is null. */ public ApplicationAdminPermission(ApplicationDescriptor application, String actions) { super(application.getApplicationId()); if( application == null || actions == null ) throw new NullPointerException( "ApplicationDescriptor and action string cannot be null!" ); this.filter = application.getApplicationId(); this.applicationDescriptor = application; this.actions = actions; init(); }
/** * This contructor should be used when creating {@code ApplicationAdminPermission} * instance for {@code checkPermission} call. * @param application the tareget of the operation, it must not be {@code null} * @param actions the required operation. it must not be {@code null} * @throws NullPointerException if any of the arguments is null. */ public ApplicationAdminPermission(ApplicationDescriptor application, String actions) { super(application.getApplicationId()); if( application == null || actions == null ) throw new NullPointerException( "ApplicationDescriptor and action string cannot be null!" ); this.filter = application.getApplicationId(); this.applicationDescriptor = application; this.actions = actions; init(); }
/** * This contructor should be used when creating {@code ApplicationAdminPermission} * instance for {@code checkPermission} call. * @param application the tareget of the operation, it must not be {@code null} * @param actions the required operation. it must not be {@code null} * @throws NullPointerException if any of the arguments is null. */ public ApplicationAdminPermission(ApplicationDescriptor application, String actions) { super(application.getApplicationId()); if( application == null || actions == null ) throw new NullPointerException( "ApplicationDescriptor and action string cannot be null!" ); this.filter = application.getApplicationId(); this.applicationDescriptor = application; this.actions = actions; init(); }
Dictionary getServiceProperties() { Dictionary props = new Hashtable(6); props.put(ApplicationHandle.APPLICATION_PID, getInstanceId()); props.put(ApplicationHandle.APPLICATION_STATE, getState()); props.put(ApplicationHandle.APPLICATION_DESCRIPTOR, getApplicationDescriptor().getApplicationId()); props.put(EclipseAppDescriptor.APP_TYPE, ((EclipseAppDescriptor) getApplicationDescriptor()).getThreadTypeString()); props.put(ApplicationHandle.APPLICATION_SUPPORTS_EXITVALUE, Boolean.TRUE); if (defaultAppInstance.booleanValue()) props.put(EclipseAppDescriptor.APP_DEFAULT, defaultAppInstance); return props; }
Dictionary getServiceProperties() { Dictionary props = new Hashtable(6); props.put(ApplicationHandle.APPLICATION_PID, getInstanceId()); props.put(ApplicationHandle.APPLICATION_STATE, getState()); props.put(ApplicationHandle.APPLICATION_DESCRIPTOR, getApplicationDescriptor().getApplicationId()); props.put(EclipseAppDescriptor.APP_TYPE, ((EclipseAppDescriptor) getApplicationDescriptor()).getThreadTypeString()); props.put(ApplicationHandle.APPLICATION_SUPPORTS_EXITVALUE, Boolean.TRUE); if (defaultAppInstance.booleanValue()) props.put(EclipseAppDescriptor.APP_DEFAULT, defaultAppInstance); return props; }
Dictionary getServiceProperties() { Dictionary props = new Hashtable(6); props.put(ApplicationHandle.APPLICATION_PID, getInstanceId()); props.put(ApplicationHandle.APPLICATION_STATE, getState()); props.put(ApplicationHandle.APPLICATION_DESCRIPTOR, getApplicationDescriptor().getApplicationId()); props.put(EclipseAppDescriptor.APP_TYPE, ((EclipseAppDescriptor) getApplicationDescriptor()).getThreadTypeString()); props.put(ApplicationHandle.APPLICATION_SUPPORTS_EXITVALUE, Boolean.TRUE); if (defaultAppInstance.booleanValue()) props.put(EclipseAppDescriptor.APP_DEFAULT, defaultAppInstance); return props; }
private IConfigurationElement getConfiguration() { IExtension applicationExtension = ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAppExtension(getApplicationDescriptor().getApplicationId()); if (applicationExtension == null) throw new RuntimeException(NLS.bind(Messages.application_notFound, getApplicationDescriptor().getApplicationId(), ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAvailableAppsMsg())); IConfigurationElement[] configs = applicationExtension.getConfigurationElements(); if (configs.length == 0) throw new RuntimeException(NLS.bind(Messages.application_invalidExtension, getApplicationDescriptor().getApplicationId())); return configs[0]; }
private IConfigurationElement getConfiguration() { IExtension applicationExtension = ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAppExtension(getApplicationDescriptor().getApplicationId()); if (applicationExtension == null) throw new RuntimeException(NLS.bind(Messages.application_notFound, getApplicationDescriptor().getApplicationId(), ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAvailableAppsMsg())); IConfigurationElement[] configs = applicationExtension.getConfigurationElements(); if (configs.length == 0) throw new RuntimeException(NLS.bind(Messages.application_invalidExtension, getApplicationDescriptor().getApplicationId())); return configs[0]; }
private IConfigurationElement getConfiguration() { IExtension applicationExtension = ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAppExtension(getApplicationDescriptor().getApplicationId()); if (applicationExtension == null) throw new RuntimeException(NLS.bind(Messages.application_notFound, getApplicationDescriptor().getApplicationId(), ((EclipseAppDescriptor) getApplicationDescriptor()).getContainerManager().getAvailableAppsMsg())); IConfigurationElement[] configs = applicationExtension.getConfigurationElements(); if (configs.length == 0) throw new RuntimeException(NLS.bind(Messages.application_invalidExtension, getApplicationDescriptor().getApplicationId())); return configs[0]; }
public void _lockApp(CommandInterpreter intp) throws Exception { String appId = intp.nextArgument(); ServiceReference application = getApplication(applicationDescriptors.getServiceReferences(), appId, ApplicationDescriptor.APPLICATION_PID, false); if (application == null) intp.println("\"" + appId + "\" does not exist or is ambigous."); //$NON-NLS-1$ //$NON-NLS-2$ else { try { ApplicationDescriptor appDesc = (ApplicationDescriptor) context.getService(application); appDesc.lock(); intp.println("Locked application: " + appDesc.getApplicationId()); //$NON-NLS-1$ } finally { context.ungetService(application); } return; } }
public void _lockApp(CommandInterpreter intp) throws Exception { String appId = intp.nextArgument(); ServiceReference application = getApplication(applicationDescriptors.getServiceReferences(), appId, ApplicationDescriptor.APPLICATION_PID, false); if (application == null) intp.println("\"" + appId + "\" does not exist or is ambigous."); //$NON-NLS-1$ //$NON-NLS-2$ else { try { ApplicationDescriptor appDesc = (ApplicationDescriptor) context.getService(application); appDesc.lock(); intp.println("Locked application: " + appDesc.getApplicationId()); //$NON-NLS-1$ } finally { context.ungetService(application); } return; } }
public void _unlockApp(CommandInterpreter intp) throws Exception { String appId = intp.nextArgument(); ServiceReference application = getApplication(applicationDescriptors.getServiceReferences(), appId, ApplicationDescriptor.APPLICATION_PID, false); if (application == null) intp.println("\"" + appId + "\" does not exist or is ambigous."); //$NON-NLS-1$ //$NON-NLS-2$ else { try { ApplicationDescriptor appDesc = (ApplicationDescriptor) context.getService(application); appDesc.unlock(); intp.println("Unlocked application: " + appDesc.getApplicationId()); //$NON-NLS-1$ } finally { context.ungetService(application); } return; } }
public void _lockApp(CommandInterpreter intp) throws Exception { String appId = intp.nextArgument(); ServiceReference application = getApplication(applicationDescriptors.getServiceReferences(), appId, ApplicationDescriptor.APPLICATION_PID, false); if (application == null) intp.println("\"" + appId + "\" does not exist or is ambigous."); //$NON-NLS-1$ //$NON-NLS-2$ else { try { ApplicationDescriptor appDesc = (ApplicationDescriptor) context.getService(application); appDesc.lock(); intp.println("Locked application: " + appDesc.getApplicationId()); //$NON-NLS-1$ } finally { context.ungetService(application); } return; } }