Examples of Invocable


Examples of javax.script.Invocable

        if (this.engine == null){
            this.getLogman().error(NO_JAVASCRIPT_MESSAGE);
            return null;
        }
        try {
            Invocable inv = (Invocable)this.engine;
            inv.invokeFunction("__onTabComplete", result, sender, args, cmd);
        }catch (Exception e){
            sender.message(e.getMessage());
            e.printStackTrace();
        }
        return result;
View Full Code Here

Examples of javax.script.Invocable

            ScriptEngineManager factory = new ScriptEngineManager();
            this.engine = factory.getEngineByName("JavaScript");
      if (this.engine == null){
    this.getLogger().severe(NO_JAVASCRIPT_MESSAGE);
      } else {
    Invocable inv = (Invocable)this.engine;
    this.engine.eval(new InputStreamReader(this.getResource("boot.js")));
    inv.invokeFunction("__scboot", this, engine);
      }
        }catch(Exception e){
            e.printStackTrace();
            this.getLogger().severe(e.getMessage());
        }finally{
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.Invocable

    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        Invocable wire = (RuntimeEndpoint) endpoint;

        AtomBindingListenerServlet servlet =
            new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle(), binding.getDescription());

        servletMapping = binding.getURI();
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.Invocable

    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        Invocable wire = (RuntimeEndpoint) endpoint;

        AtomBindingListenerServlet servlet =
            new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle(), binding.getDescription());

        servletMapping = binding.getURI();
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.Invocable

    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        Invocable wire = (RuntimeEndpoint) endpoint;

        AtomBindingListenerServlet servlet =
            new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle(), binding.getDescription());

        servletMapping = binding.getURI();
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.Invocable

    public boolean supportsOneWayInvocation() {
        return false;
    }

    public void start() {
        Invocable wire = (RuntimeEndpoint) endpoint;

        AtomBindingListenerServlet servlet =
            new AtomBindingListenerServlet(wire, messageFactory, mediator, binding.getTitle(), binding.getDescription());

        servletMapping = binding.getURI();
View Full Code Here

Examples of org.glassfish.jersey.server.model.Invocable

    private ErrorTemplate getErrorTemplate() {
        final ExtendedUriInfo uriInfo = uriInfoProvider.get();
        final ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod();

        if (matchedResourceMethod != null) {
            final Invocable invocable = matchedResourceMethod.getInvocable();

            ErrorTemplate errorTemplate = invocable.getHandlingMethod().getAnnotation(ErrorTemplate.class);
            if (errorTemplate == null) {
                Class<?> handlerClass = invocable.getHandler().getHandlerClass();

                if (invocable.isInflector() && TemplateInflector.class.isAssignableFrom(invocable.getHandler().getHandlerClass
                        ())) {

                    handlerClass = ((TemplateInflector) invocable.getHandler().getInstance(null)).getModelClass();
                }

                errorTemplate = handlerClass.getAnnotation(ErrorTemplate.class);
            }
View Full Code Here

Examples of org.glassfish.jersey.server.model.Invocable

            effectiveTypes.addAll(methodTypes);
        }

        boolean mediaTypesFromWorkers = effectiveTypes.isEmpty();
        if (workers != null && mediaTypesFromWorkers) {
            final Invocable invocableMethod = resourceMethod.getInvocable();

            // If not predefined from method - get it from workers.
            if (inputTypes) {
                fillInputTypesFromWorkers(effectiveTypes, invocableMethod);
            } else {
                fillOutputTypesFromWorkers(effectiveTypes, invocableMethod.getRawResponseType());
            }
            mediaTypesFromWorkers = !effectiveTypes.isEmpty();

            // If still empty - get all available.
            if (!mediaTypesFromWorkers) {
View Full Code Here

Examples of org.glassfish.jersey.server.model.Invocable

        if (usePreSelectedMediaType(selectedMethod, acceptableMediaTypes)) {
            return selectedMethod.produces.getCombinedMediaType();
        }

        final ResourceMethod resourceMethod = selectedMethod.methodAcceptorPair.model;
        final Invocable invocable = resourceMethod.getInvocable();

        // Entity class can be null when considering HEAD method || empty entity.
        final Class<?> responseEntityClass = entityClass == null ? invocable.getRawRoutingResponseType() : entityClass;
        final Method handlingMethod = invocable.getHandlingMethod();

        CombinedClientServerMediaType selected = null;

        for (final MediaType acceptableMediaType : acceptableMediaTypes) {
            // Use writers suitable for entity class to determine the media type.
View Full Code Here

Examples of org.glassfish.jersey.server.model.Invocable

        // so it can be written.
        return selectedMethod.produces.getCombinedMediaType();
    }

    private boolean isWriteable(final RequestSpecificConsumesProducesAcceptor candidate) {
        final Invocable invocable = candidate.methodAcceptorPair.model.getInvocable();
        final Class<?> responseType = Primitives.wrap(invocable.getRawRoutingResponseType());

        if (Response.class.isAssignableFrom(responseType)
                || Void.class.isAssignableFrom(responseType)) {
            return true;
        }

        final Type genericType = invocable.getRoutingResponseType();

        final Type genericReturnType = genericType instanceof GenericType ?
                ((GenericType) genericType).getType() : genericType;

        for (final MessageBodyWriter writer : workers.getMessageBodyWritersForType(responseType)) {
            if (writer.isWriteable(responseType, genericReturnType,
                    invocable.getHandlingMethod().getDeclaredAnnotations(),
                    candidate.produces.getCombinedMediaType())) {
                return true;
            }
        }
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.