Examples of Activator


Examples of aQute.bnd.plugin.Activator

    /**
     * @see IActionDelegate#run(IAction)
     */
    public void run(IAction action) {
        Activator activator = Activator.getDefault();

        try {
            if (locations != null) {
                for (int i = 0; i < locations.length; i++) {
                    try {
                        File mf = locations[i].getLocation().toFile();
                        if (mf.getName().equals(Project.BNDFILE)) {
                            Project project = Workspace.getProject(mf
                                    .getParentFile());
                            File[] files = project.build();
                            String target = "";
                            if ( files != null ) {
                                for ( File f : files ) {
                                    target += f + " ";
                                   
                                }
                            }
                            activator.report(true, true, project, "Building "
                                    + project, "Created files " + target );
                        } else {
                            Builder builder = setBuilder(activator,
                                    locations[i].getProject(), mf);

                            File cwd = mf.getAbsoluteFile().getParentFile();
                            File target;

                            builder.build();
                            String name = builder.getBsn() + ".jar";

                            Jar jar = builder.getJar();

                            String path = builder.getProperty("-output");
                            if (path == null) {
                                target = new File(cwd, name);
                            } else {
                                target = new File(path);
                                if (!target.isAbsolute())
                                    target = new File(cwd, path);
                                if (target.isDirectory()) {
                                    target = new File(target, name);
                                }
                            }

                            target.delete();
                            if (builder.getErrors().size() > 0) {
                                activator.error(builder.getErrors());
                            } else {
                                jar.write(target);

                                File copy = activator.getCopy();
                                if (copy != null) {
                                    copy = new File(copy, target.getName());
                                    jar.write(copy);
                                }
                                if (builder.getWarnings().size() > 0) {
                                    activator.warning(builder.getWarnings());
                                } else {
                                    if (activator.getReportDone()) {
                                        String p = target.getPath();
                                        if (p.startsWith(cwd.getAbsolutePath()))
                                            p = p
                                                    .substring(cwd
                                                            .getAbsolutePath()
                                                            .length() + 1);
                                        String msg = "Saved as " + p;
                                        if (copy != null)
                                            msg += " and copied to " + copy;
                                        activator.message(msg);
                                    }
                                }
                            }
                            builder.close();
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        activator.error("While generating JAR " + locations[i],
                                e);
                    }
                    locations[i].getParent().refreshLocal(1, null);
                }
            }
        } catch (Exception e) {
            activator.error("Error in bnd", e);
        }
    }
View Full Code Here

Examples of com.eclipsesource.jaxrs.provider.gson.internal.Activator

public class ActivatorTest {
 
  @Test
  public void testStartRegistersProvider() throws Exception {
    Activator activator = new Activator();
    BundleContext context = mock( BundleContext.class );
   
    activator.start( context );
   
    verify( context ).registerService( eq( GsonProvider.class.getName() ), any( GsonProvider.class ), any( Dictionary.class ) );
  }
View Full Code Here

Examples of com.eclipsesource.jaxrs.provider.gson.internal.Activator

    verify( context ).registerService( eq( GsonProvider.class.getName() ), any( GsonProvider.class ), any( Dictionary.class ) );
  }
 
  @Test
  public void testStopUnregistersProvider() throws Exception {
    Activator activator = new Activator();
    BundleContext context = mock( BundleContext.class );
    ServiceRegistration registration = mock( ServiceRegistration.class );
    when( context.registerService( any( String.class ), anyObject(), any( Dictionary.class ) ) )
      .thenReturn( registration );
   
    activator.start( context );
    activator.stop( context );
   
    verify( registration ).unregister();
  }
View Full Code Here

Examples of com.sun.corba.se.spi.activation.Activator

        if (data.getServerIsORBActivated()) {
            try {
                Locator locator = LocatorHelper.narrow(
                    orb.resolve_initial_references(
                        ORBConstants.SERVER_LOCATOR_NAME )) ;
                Activator activator = ActivatorHelper.narrow(
                    orb.resolve_initial_references(
                        ORBConstants.SERVER_ACTIVATOR_NAME )) ;
                Collection serverEndpoints =
                    orb.getCorbaTransportManager().getAcceptors(null, null);
                EndPointInfo[] endpointList =
                    new EndPointInfo[serverEndpoints.size()];
                Iterator iterator = serverEndpoints.iterator();
                int i = 0 ;
                while (iterator.hasNext()) {
                    Object n = iterator.next();
                    if (! (n instanceof LegacyServerSocketEndPointInfo)) {
                        continue;
                    }
                    LegacyServerSocketEndPointInfo ep =
                        (LegacyServerSocketEndPointInfo) n;
                    // REVISIT - use exception instead of -1.
                    int port = locator.getEndpoint(ep.getType());
                    if (port == -1) {
                        port = locator.getEndpoint(SocketInfo.IIOP_CLEAR_TEXT);
                        if (port == -1) {
                            throw new Exception(
                                "ORBD must support IIOP_CLEAR_TEXT");
                        }
                    }

                    ep.setLocatorPort(port);

                    endpointList[i++] =
                        new EndPointInfo(ep.getType(), ep.getPort());
                }

                activator.registerEndpoints(
                    data.getPersistentServerId(), data.getORBId(),
                        endpointList);
            } catch (Exception ex) {
                throw wrapper.persistentServerInitError(
                    CompletionStatus.COMPLETED_MAYBE, ex ) ;
View Full Code Here

Examples of com.sun.corba.se.spi.activation.Activator

            installMethod, uninstallMethod, shutdownMethod ) ;

        int serverId = getServerId() ;

        try {
            Activator activator = ActivatorHelper.narrow(
                orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME ));
            activator.active(serverId, serverObj);
        } catch (Exception ex) {
            logTerminal( "exception " + ex.getMessage(),
                REGISTRATION_FAILED ) ;
        }
    }
View Full Code Here

Examples of com.sun.corba.se.spi.activation.Activator

            installMethod, uninstallMethod, shutdownMethod ) ;

        int serverId = getServerId() ;

        try {
            Activator activator = ActivatorHelper.narrow(
                orb.resolve_initial_references( ORBConstants.SERVER_ACTIVATOR_NAME ));
            activator.active(serverId, serverObj);
        } catch (Exception ex) {
            logTerminal( "exception " + ex.getMessage(),
                REGISTRATION_FAILED ) ;
        }
    }
View Full Code Here

Examples of com.sun.corba.se.spi.activation.Activator

        if (data.getServerIsORBActivated()) {
            try {
                Locator locator = LocatorHelper.narrow(
                    orb.resolve_initial_references(
                        ORBConstants.SERVER_LOCATOR_NAME )) ;
                Activator activator = ActivatorHelper.narrow(
                    orb.resolve_initial_references(
                        ORBConstants.SERVER_ACTIVATOR_NAME )) ;
                Collection serverEndpoints =
                    orb.getCorbaTransportManager().getAcceptors(null, null);
                EndPointInfo[] endpointList =
                    new EndPointInfo[serverEndpoints.size()];
                Iterator iterator = serverEndpoints.iterator();
                int i = 0 ;
                while (iterator.hasNext()) {
                    Object n = iterator.next();
                    if (! (n instanceof LegacyServerSocketEndPointInfo)) {
                        continue;
                    }
                    LegacyServerSocketEndPointInfo ep =
                        (LegacyServerSocketEndPointInfo) n;
                    // REVISIT - use exception instead of -1.
                    int port = locator.getEndpoint(ep.getType());
                    if (port == -1) {
                        port = locator.getEndpoint(SocketInfo.IIOP_CLEAR_TEXT);
                        if (port == -1) {
                            throw new Exception(
                                "ORBD must support IIOP_CLEAR_TEXT");
                        }
                    }

                    ep.setLocatorPort(port);

                    endpointList[i++] =
                        new EndPointInfo(ep.getType(), ep.getPort());
                }

                activator.registerEndpoints(
                    data.getPersistentServerId(), data.getORBId(),
                        endpointList);
            } catch (Exception ex) {
                throw wrapper.persistentServerInitError(
                    CompletionStatus.COMPLETED_MAYBE, ex ) ;
View Full Code Here

Examples of com.volantis.synergetics.osgi.impl.framework.watcher.Activator


       BundleContext systemContext = osgi.getBundleContext();

        // Activate the watcher bundle.
        watcherActivator = new Activator();
        try {
            watcherActivator.start(systemContext);
        } catch (Exception e) {
            IllegalStateException exception = new IllegalStateException(
                    "Could not start watcher");
View Full Code Here

Examples of dk.contix.eclipse.hudson.Activator

    getButton(IDialogConstants.OK_ID).setEnabled(true);
    progressBar.setVisible(false);
  }

  void digException(Exception e) {
    Activator myPlugin = Activator.getDefault();
    myPlugin.getLog().log(
        new Status(IStatus.ERROR, myPlugin.getBundle()
            .getSymbolicName(), "Error digging for Hudson servers",
            e));
  }
View Full Code Here

Examples of org.apache.ace.managementagent.Activator

    public void run() throws Exception {
        FrameworkFactory factory = (FrameworkFactory) Class.forName("org.apache.felix.framework.FrameworkFactory").newInstance();

        List activators = new ArrayList();
        activators.add(new Activator());
        Map frameworkProperties = new HashMap();
        frameworkProperties.put("felix.systembundle.activators", activators);
        frameworkProperties.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, "org.osgi.service.deploymentadmin;version=\"1.0\","
                + "org.osgi.service.deploymentadmin.spi;version=\"1.0\","
                + "org.osgi.service.cm;version=\"1.3\","
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.