@Test public void testRegister() { assertFalse(new ServiceManagementApplicationLoginRegistry().register( new Application("bundle.helper"))); }
@Override public boolean register(final Application application) { final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(), String.format("Library/LoginItems/%s.app", application.getName())); if(!finder.register(helper)) { log.warn(String.format("Failed to register %s (%s) with launch services", helper, finder.getDescription(application.getIdentifier()))); } if(!ServiceManagementFunctions.library.SMLoginItemSetEnabled(application.getIdentifier(), true)) { log.warn(String.format("Failed to register %s as login item", application)); return false; } return true; }
ServiceManagementApplicationLoginRegistry implements ApplicationLoginRegistry { @Override public boolean register(final Application application) { final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(), String.format("Library/LoginItems/%s.app", application.getName())); if(!finder.register(helper)) { log.warn(String.format("Failed to register %s (%s) with launch services", helper, finder.getDescription(application.getIdentifier()))); } if(!ServiceManagementFunctions.library.SMLoginItemSetEnabled(application.getIdentifier(), true)) { log.warn(String.format("Failed to register %s as login item", application)); return false; } return true; } }
ServiceManagementApplicationLoginRegistry implements ApplicationLoginRegistry { @Override public boolean register(final Application application) { final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(), String.format("Library/LoginItems/%s.app", application.getName())); if(!finder.register(helper)) { log.warn(String.format("Failed to register %s (%s) with launch services", helper, finder.getDescription(application.getIdentifier()))); } if(!ServiceManagementFunctions.library.SMLoginItemSetEnabled(application.getIdentifier(), true)) { log.warn(String.format("Failed to register %s as login item", application)); return false; } return true; }  }
ServiceManagementApplicationLoginRegistry implements ApplicationLoginRegistry { @Override public boolean register(final Application application) { final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(), String.format("Library/LoginItems/%s.app", application.getName())); if(!finder.register(helper)) { log.warn(String.format("Failed to register %s (%s) with launch services", helper, finder.getDescription(application.getIdentifier()))); } if(!ServiceManagementFunctions.library.SMLoginItemSetEnabled(application.getIdentifier(), true)) { log.warn(String.format("Failed to register %s as login item", application)); return false; } return true; }  @Override boolean register(final Application application); @Override boolean unregister(final Application application); }
ServiceManagementApplicationLoginRegistry implements ApplicationLoginRegistry { @Override public boolean register(final Application application) { final Local helper = new FinderLocal(new BundleApplicationResourcesFinder().find().getParent(), String.format("Library/LoginItems/%s.app", application.getName())); if(!finder.register(helper)) { log.warn(String.format("Failed to register %s (%s) with launch services", helper, finder.getDescription(application.getIdentifier()))); } if(!ServiceManagementFunctions.library.SMLoginItemSetEnabled(application.getIdentifier(), true)) { log.warn(String.format("Failed to register %s as login item", application)); return false; } return true; }  @Override boolean register(final Application application); @Override boolean unregister(final Application application);  }