Package java.io

Examples of java.io.Serializable


        return payload.toString();
    }

    public static Object commandPayload(CommandContext context, String param)
        throws ExpressionEvaluationException, FunctionExecutionException{
        Serializable payload = context.getCommandPayload();
        if(payload == null) {
            return null;
        }
       
        // 1-arg form - assume payload is a Properties object
        if(payload instanceof Properties) {
            return ((Properties)payload).getProperty(param);
        }           
        // Payload was bad
        throw new ExpressionEvaluationException(QueryPlugin.Util.getString("ExpressionEvaluator.Expected_props_for_payload_function", "commandPayload", payload.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$
    }
View Full Code Here


      return;
    }
    PropertyDefinitionSimple propertyDefinitionSimple = (PropertyDefinitionSimple) propertyDefinition;
    if (metaType.isSimple()) {
      SimpleValue defaultSimpleValue = (SimpleValue) defaultValue;
      Serializable value = defaultSimpleValue.getValue();
      propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
    } else { // defaultValueMetaType.isEnum()
      EnumValue defaultEnumValue = (EnumValue) defaultValue;
      Serializable value = defaultEnumValue.getValue();
      propertyDefinitionSimple.setDefaultValue((value != null) ? value.toString() : null);
    }
  }
View Full Code Here

        if(LOG.isDebugEnabled()) {
            final long latency = System.currentTimeMillis() - request.getInvoked();
            LOG.debug("Latency of the request `" + request + "': "
                    + (latency < 0 ? "N/A" : (latency + "(msec)")));
        }
        final Serializable result = requestManager.dispatchRequest(request);
        return new StampedResult(result);
    }
View Full Code Here

        // schedule task
        RequestContext rc = new RequestContext(request);
        _sched.addTask(rc);

        // execute task
        final Serializable result;
        ReplyPattern replyPtn = request.getReplyPattern();
        if(replyPtn == ReplyPattern.RESPONSE) {// synchronous response
            Serializable promptResult = rc.getResult();
            if(promptResult != null) {
                result = promptResult;
            } else {
                syncSignal(true, rc);
                result = rc.getResult();
View Full Code Here

            ResultHandler handler = request.getResultHandler();
            if(handler == null) {
                throw new IllegalStateException("ResultHandler is not set for the Callback reply pattern on Request#"
                        + request.getIdentifier());
            }
            Serializable result = rc.getResult();
            if(result == null) {
                Throwable fault = rc.getFault();
                if(fault != null) {
                    handler.handleError(request, fault);
                    return;
                }
                long timeout = request.getTimeout();
                if(timeout != Request.NO_TIMEOUT) {
                    String timeoutMsg = "Request# " + request.getIdentifier()
                            + " has been timeout since the request took over " + timeout / 1000
                            + " seconds";
                    LOG.warn(timeoutMsg);
                    handler.handleError(request, timeoutMsg);
                    return;
                }
                LOG.warn("null result for Request#" + request.getIdentifier());
            }
            handler.handleResult(result);
        } else if(type == ReplyPattern.POLL) {
            String rid = request.getIdentifier();
            Serializable result = rc.getResult();
            try {
                _pendingPolled.put(rid, result);
            } catch (CacheException e) {
                throw new IllegalStateException(e);
            }
View Full Code Here

            _resHandler.onResponse(rc);
            return;
        } finally {
            _runningThreads.remove(rc);
        }
        final Serializable result = wrapResult(resultSeq, module.getExpression(), queryRequest, dynEnv);
        rc.setResult(result);

        try {
            _resHandler.onResponse(rc);
        } catch (RemoteException re) {
View Full Code Here

    }

    protected final Serializable wrapResult(final Sequence result, final XQExpression queryExpr, final QueryRequest request, final DynamicContext dynEnv) {
        assert (dynEnv != null);
        final ReturnType returnType = request.getReturnType();
        final Serializable ret;
        switch(returnType) {
            case SEQUENCE:
                final List<Item> materialized = result.materialize();
                ret = new ValueSequence(materialized, dynEnv);
                break;
View Full Code Here


    private final Serializable ser(Object o)
    {

        Serializable serializable;

        try
        {
            serializable = (Serializable) o;
        }
View Full Code Here


    public final void addObject(Object userKey, Object cacheObject)
    {

        Serializable k = ser(userKey);
        Serializable v = ser(cacheObject);

        cache.put(new Element(k, v));
    }
View Full Code Here

            return;
        } finally {
            _runningThreads.remove(rc);
        }

        final Serializable result = wrapResult(resultSeq, queryExpr, queryRequest, dynEnv);
        rc.setResult(result);

        try {
            _resHandler.onResponse(rc);
        } catch (RemoteException re) {
View Full Code Here

TOP

Related Classes of java.io.Serializable

Copyright © 2018 www.massapicom. 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.