Examples of ServiceLocator


Examples of org.eclipse.aether.spi.locator.ServiceLocator

        assertNotNull( repoSys );
    }

    public void testGetMetadataGeneratorFactories()
    {
        ServiceLocator locator = MavenRepositorySystemUtils.newServiceLocator();
        assertEquals( 2, locator.getServices( MetadataGeneratorFactory.class ).size() );
    }
View Full Code Here

Examples of org.eclipse.ui.internal.services.ServiceLocator

    Assert.isNotNull(editor);
    this.multiPageEditor = multiPageEditor;
    this.editor = editor;

    final IServiceLocator parentServiceLocator = multiPageEditor.getSite();
    serviceLocator = new ServiceLocator(parentServiceLocator);

    initializeDefaultServices();
  }
View Full Code Here

Examples of org.eclipse.ui.internal.services.ServiceLocator

    Assert.isNotNull(parentViewSite);
    parentSite = parentViewSite;
    subActionBars = new SubActionBars(parentViewSite.getActionBars(), this);

    // Initialize the service locator.
    this.serviceLocator = new ServiceLocator(parentSite);
    initializeDefaultServices();
  }
View Full Code Here

Examples of org.eclipse.ui.internal.services.ServiceLocator

 
  public IActionBars getActionBars() {
    return new EditorActionBars((WorkbenchPage) PlatformUI.getWorkbench()
        .getActiveWorkbenchWindow().getActivePage(),
        new ServiceLocator(), "simple") {
     
      public void setGlobalActionHandler(String actionID, IAction handler) {

      }
    };
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

             * Set up the default habitat in Globals as soon as we know
             * which habitat we'll use.
             */
            Globals.setDefaultHabitat(habitat);
           
            ServiceLocator locator = habitat;
           
            DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
            DynamicConfiguration config = dcs.createDynamicConfiguration();
           
            /*
             * Remove any already-loaded startup context so we can replace it
             * with the ACC one.
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

     * @throws com.sun.enterprise.module.bootstrap.BootException
     * @throws java.net.URISyntaxException
     */
    private static ServiceLocator prepareHabitat(
            final ClassLoader loader) {
        ServiceLocator serviceLocator = ServiceLocatorFactory.getInstance().create("default");

        habitat = serviceLocator;
       
        try {
          HK2Populator.populate(serviceLocator, new ClasspathDescriptorFileFinder(loader), null);
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

            if (loginErrorPage == null) {
                throw new AuthException("'loginErrorPage' "
                        + "must be supplied as a property in the provider-config "
                        + "in the domain.xml file!");
            }
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            Domain domain = habitat.getService(Domain.class);
            NetworkListener adminListener = domain.getServerNamed("server").getConfig().getNetworkConfig().getNetworkListener("admin-listener");

            if (restURL.contains(TOKEN_ADMIN_LISTENER_PORT)) {
                restURL = restURL.replace(TOKEN_ADMIN_LISTENER_PORT, adminListener.getPort());
            }

      String host = adminListener.getAddress();
      if (! ("localhost".equals(host) || "0.0.0.0".equals(host))){
                restURL = restURL.replace("localhost", adminListener.getAddress());
            }

            //If secure admin is enabled, we need to ensure using https
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            if (restURL.startsWith("http:") && (SecureAdmin.Util.isEnabled(secureAdmin))) {
                restURL = restURL.replace("http:", "https:");
            }
        }
    }
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

    public static void initialize(Client client) {
        if (client == null) {
            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.setProperty(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
            Throwable cause = ex;
            int lcv = 0;
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

    /**
     * Given a command name, return the name of the class that implements that
     * command in the server.
     */
    private static String getCommandClass(String cmdName) {
        ServiceLocator h = getManHabitat();
        String cname = "org.glassfish.api.admin.AdminCommand";
        ActiveDescriptor<?> ad = h.getBestDescriptor(
                BuilderHelper.createNameAndContractFilter(cname, cmdName));
        if (ad == null)
            return null;
        return ad.getImplementation();
    }
View Full Code Here

Examples of org.glassfish.hk2.api.ServiceLocator

    /**
     * Given a command name, return the name of the class that implements
     * that command in the server.
     */
    private static String getCommandClass(String cmdName) {
        ServiceLocator h = getManHabitat();
        String cname = "org.glassfish.api.admin.AdminCommand";
        ActiveDescriptor<?> ad = h.getBestDescriptor(
                BuilderHelper.createNameAndContractFilter(cname, cmdName));
        if (ad == null) return null;
        return ad.getImplementation();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.