Examples of IHandler


Examples of org.apache.juddi.handler.IHandler

      // lookup the appropriate xml handler, throw
      // an UnsupportedException if one could not be
      // located.

      IHandler requestHandler = maker.lookup(function);
      if (requestHandler == null)
        throw new UnsupportedException("The request " +
          "type is unknown: " +function);

      // unmarshal the raw xml into an associated
      // jUDDI request object.

      RegistryObject uddiRequest = requestHandler.unmarshal(request);

      // make the monitor inspect the UDDI request
      // object
      if (monitor != null)
        monitor.inspectRegistryObject(uddiRequest);

      // Determine if this message came from through
      // the Publish, Inquiry or Admin API and handle
      // it appropriately.

      Object juddiServlet = messageContext.getProperty("transport.http.servlet");

      // confirm that the the appropriate endpoint
      // was used to invoke the selected jUDDI/UDDI
      // function.

      if((juddiServlet instanceof InquiryServlet) &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Inquiry)))
      {
        throw new RegistryException("Inquiry API " +
          "does not support function: "+function);
      }
      else if (juddiServlet instanceof PublishServlet &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Publish) &&
          !(uddiRequest instanceof org.apache.juddi.datatype.request.SecurityPolicy)))
      {
        throw new RegistryException("Publish API " +
          "does not support function: "+function);
      }
      else if ((juddiServlet instanceof AdminServlet) &&    // Admin
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Admin)))
      {
        throw new RegistryException("Admin API " +
          "does not support function: "+function);
      }

      // grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute
      // the requested UDDI function.

      RegistryObject uddiResponse = null;
     
      RegistryEngine registry = RegistryServlet.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResponse = registry.execute(uddiRequest);
      else
        throw new BusyException("The Registry is unavailable");

      // create a new 'temp' XML element. This
      // element is used as a container in which
      // to marshal the UDDI response into.

      Document document = XMLUtils.createDocument();
      Element element = document.createElement("temp");

      // lookup the appropriate response handler
      // and marshal the juddi object into the
      // appropriate xml format (we only support
      // uddi v2.0 at this time) attaching results
      // to the temporary 'temp' element.

      IHandler responseHandler = maker.lookup(uddiResponse.getClass().getName());
      responseHandler.marshal(uddiResponse,element);

      // grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and appending
      // this child to the soap response body.
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

    // detail element.

    if (dispRpt != null)
    {
      Element fDetailElement = document.createElement("detail");
      IHandler handler = maker.lookup(DispositionReportHandler.TAG_NAME);
      handler.marshal(dispRpt,fDetailElement);
      fault.appendChild(fDetailElement);
    }

    return fault;
  }
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

            String function = uddiReq.getLocalName();
            if ((function == null) || (function.trim().length() == 0))
                throw new FatalErrorException("The name of the UDDI request " +
                        "could not be identified.");
            IHandler requestHandler = maker.lookup(function);
            if (requestHandler == null)
                throw new UnsupportedException("The UDDI request " +
                        "type specified is unknown: " + function);

            String generic = uddiReq.getAttribute("generic");
            if (generic == null)
                throw new FatalErrorException("A UDDI generic attribute " +
                        "value was not found for UDDI request: " + function + " (The " +
                        "'generic' attribute must be present)");
            else if (!generic.equals(IRegistry.UDDI_V2_GENERIC))
                throw new UnsupportedException("Currently only UDDI v2 " +
                        "requests are supported. The generic attribute value " +
                        "received was: " + generic);

            // Unmarshal the raw xml into the appropriate jUDDI
            // request object.

            RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
            if(uddiReqObj == null)
               throw new FatalErrorException("Uddi Request is null");

            // Grab a reference to the shared jUDDI registry
            // instance (make sure it's running) and execute the
            // requested UDDI function.

            RegistryObject uddiResObj = null;
            RegistryEngine registry = RegistryServlet.getRegistry();
            if ((registry != null) && (registry.isAvailable()))
                uddiResObj = registry.execute(uddiReqObj);
            else
                throw new BusyException("The Registry is currently unavailable.");

            // Lookup the appropriate response handler which will
            // be used to marshal the UDDI object into the appropriate
            // xml format.

            IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
            if (responseHandler == null)
                throw new FatalErrorException("The response object " +
                        "type is unknown: " + uddiResObj.getClass().getName());

            // Create a new 'temp' XML element to use as a container
            // in which to marshal the UDDI response data into.

            DocumentBuilder docBuilder = getDocumentBuilder();
            Document document = docBuilder.newDocument();
            Element element = document.createElement("temp");

            // Lookup the appropriate response handler and marshal
            // the juddi object into the appropriate xml format (we
            // only support UDDI v2.0 at this time).  Attach the
            // results to the body of the SOAP response.

            responseHandler.marshal(uddiResObj, element);
            log.debug("Response that will be sent:");
            log.debug(XMLUtils.toString((Element) element.getFirstChild()));

            // Grab a reference to the 'temp' element's
            // only child here (this has the effect of
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

          warningsToLog);
      if (enabledWhenExpression == ERROR_EXPRESSION) {
        continue;
      }

      final IHandler proxy = new HandlerProxy(configurationElement,
          ATT_CLASS, enabledWhenExpression, evaluationService);
      handlerActivations.add(handlerService.activateHandler(commandId,
          proxy, activeWhenExpression));

      // Read out the help context identifier.
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    while (localActivationItr.hasNext()) {
      final Object object = localActivationItr.next();
      if (object instanceof IHandlerActivation) {
        final IHandlerActivation localActivation = (IHandlerActivation) object;
        final String commandId = localActivation.getCommandId();
        final IHandler handler = localActivation.getHandler();
        final IHandlerActivation parentActivation = parent
            .activateHandler(commandId, handler, defaultExpression);
        parentActivations.add(parentActivation);
        localActivationsToParentActivations.put(localActivation,
            parentActivation);
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

   *
   * @see org.eclipse.ui.internal.actions.CommandAction#runWithEvent(org.eclipse.swt.widgets.Event)
   */
  public void runWithEvent(Event event) {
    if (partHandler != null) {
      IHandler oldHandler = getParameterizedCommand().getCommand()
          .getHandler();
      try {
        getParameterizedCommand().getCommand().setHandler(partHandler);
        getParameterizedCommand().executeWithChecks(event, appContext);
      } catch (ExecutionException e) {
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

  }

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression childExpression = childActivation.getExpression();
    final AndExpression expression;
    if (childExpression instanceof AndExpression) {
      expression = (AndExpression) childExpression;
    } else {
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

    service.deactivateHandlers(handlerActivations);
    final Iterator activationItr = handlerActivations.iterator();
    while (activationItr.hasNext()) {
      final IHandlerActivation activation = (IHandlerActivation) activationItr
          .next();
      final IHandler handler = activation.getHandler();
      if (handler != null) {
        handler.dispose();
      }
    }
    handlerActivations.clear();
  }
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

  }

  public final IHandlerActivation activateHandler(
      final IHandlerActivation childActivation) {
    final String commandId = childActivation.getCommandId();
    final IHandler handler = childActivation.getHandler();
    final Expression expression = childActivation.getExpression();
    final int depth = childActivation.getDepth() + 1;
    final IHandlerActivation localActivation = new HandlerActivation(
        commandId, handler, expression, depth, this);
    handlerAuthority.activateHandler(localActivation);
View Full Code Here

Examples of org.eclipse.core.commands.IHandler

   */
  public final Object executeCommandInContext(
      final ParameterizedCommand command, final Event trigger,
      IEvaluationContext context) throws ExecutionException,
      NotDefinedException, NotEnabledException, NotHandledException {
    IHandler oldHandler = command.getCommand().getHandler();

    IHandler handler = findHandler(command.getId(), context);
    boolean enabled = true;
    if (handler instanceof HandlerProxy) {
      enabled = ((HandlerProxy) handler).getProxyEnabled();
    }

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.