TODO: interceptors should get a wrapped object which includes the serialized version
332497
@Override
    public Object interceptGet(String mapName, Object value) {
        MapContainer mapContainer = getMapContainer(mapName);
        InterceptorRegistry interceptorRegistry = mapContainer.getInterceptorRegistry();
        List<MapInterceptor> interceptors = interceptorRegistry.getInterceptors();
        Object result = null;
        if (!interceptors.isEmpty()) {
            result = toObject(value);
            for (MapInterceptor interceptor : interceptors) {
                Object temp = interceptor.interceptGet(result);
                if (temp != null) {
                    result = temp;
                }
            }
        }
        return result == null ? value : result;
    }
1179762
@Override
    public byte[] serialize(Object theObject)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.entry(tc, "serialize = " + theObject.getClass());
        }

        byte[] idBytes = null;

        if (theObject instanceof WrapperProxy) // F58064
        {
            WrapperProxyState state = WrapperProxyState.getWrapperProxyState(theObject);
            idBytes = state.getSerializerBytes();

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "serialized a WrapperProxy for " + state);
        }
        else
        {
            EJSWrapperBase wrapper = null;
            if (theObject instanceof EJSWrapperBase)
            {
                wrapper = (EJSWrapperBase) theObject;
            }
            else if (theObject instanceof LocalBeanWrapper) // d609263
            {
                wrapper = EJSWrapperCommon.getLocalBeanWrapperBase((LocalBeanWrapper) theObject);
            }
            else
            {
                throw new IllegalArgumentException(" theObject parameter must be a EJB_LOCAL, EJB_LOCAL_HOME"
                                                   + ", EJB_BUSINESS_LOCAL, or EJB_BUSINESS_REMOTE ObjectType. Use the getObjectType"
                                                   + " to obtain the ObjectType.");
            }

            // Get the BeanId and WrapperInterface from the wrapper.
            BeanId beanId = wrapper.beanId;
            WrapperInterface wrapperInterface = wrapper.ivInterface;
            BeanMetaData bmd = wrapper.bmd;

            // Use type of wrapper interface to determine whether to
            // serialize a WrapperId or a BeanId object.
            if (wrapperInterface == WrapperInterface.BUSINESS_LOCAL)
            {
                // Serialize a WrapperId for local business interface.
                int interfaceIndex = wrapper.ivBusinessInterfaceIndex;
                String interfaceName;
                if (interfaceIndex == EJSWrapperBase.AGGREGATE_LOCAL_INDEX) { // F743-34304
                    interfaceName = EJSWrapperBase.AGGREGATE_EYE_CATCHER; // d677413
                } else {
                    Class<?> biClass = bmd.ivBusinessLocalInterfaceClasses[interfaceIndex];
                    interfaceName = biClass.getName();
                }
                WrapperId wrapperId = new WrapperId(beanId.getByteArrayBytes() //d458325
                , interfaceName
                                , interfaceIndex);
                idBytes = wrapperId.getBytes();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "serialized a WrapperId for BeanId = " + beanId
                                 + ", local business interface = " + interfaceName);
                }
            }
            else if (wrapperInterface == WrapperInterface.BUSINESS_REMOTE)
            {
                // Serialize a WrapperId for remote business interface.
                int interfaceIndex = wrapper.ivBusinessInterfaceIndex;
                Class<?> biClass = bmd.ivBusinessRemoteInterfaceClasses[interfaceIndex];
                String interfaceName = biClass.getName();
                WrapperId wrapperId = new WrapperId(beanId.getByteArrayBytes() //d458325
                , interfaceName
                                , interfaceIndex);
                idBytes = wrapperId.getBytes();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "serialized a WrapperId for BeanId = " + beanId
                                 + ", remote business interface = " + interfaceName);
                }
            }
            else if (wrapperInterface == WrapperInterface.BUSINESS_RMI_REMOTE)
            {
                // Serialize a WrapperId for a RMI remote business interface.
                int interfaceIndex = wrapper.ivBusinessInterfaceIndex;
                Class<?> biClass = bmd.ivBusinessRemoteInterfaceClasses[interfaceIndex];
                String interfaceName = biClass.getName();
                WrapperId wrapperId = new WrapperId(beanId.getByteArrayBytes() //d458325
                , interfaceName
                                , interfaceIndex);
                idBytes = wrapperId.getBytes();
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "serialized a WrapperId for BeanId = " + beanId
                                 + ", RMI remote business interface = " + interfaceName);
                }
            }
            else
            {
                // Not a business interface, so must be a local or remote interface of
                // a 2.1 bean or a 2.1 view of a EJB 3 bean.  Either case, we only need
                // to save the BeanId for this kind of wrapper.
                idBytes = beanId.getByteArrayBytes(); //d466573
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "serialized a BeanId = " + beanId);
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.exit(tc, "serialize");
        }

        return idBytes;
    }
730051
def intercept_service(self, continuation, handler_call_details):
        
        rpc_method_handler = self._get_rpc_handler(handler_call_details)
        if rpc_method_handler.response_streaming:
            if self._wrapped.is_streaming:
                # `self._wrapped` is a `StreamServerInterceptor`
                return self._wrapped.intercept_service(
                    continuation, handler_call_details)
        else:
            if not self._wrapped.is_streaming:
                # `self._wrapped` is a `UnaryServerInterceptor`
                return self._wrapped.intercept_service(
                    continuation, handler_call_details)

        # skip the interceptor due to type mismatch
        return continuation(handler_call_details)
1133845
public static Object getSerializedObjectFromString(Object asyncService, String serializedData)
    throws SerializationException {

        SerializationStreamFactory ssf = (SerializationStreamFactory)asyncService;
        return ssf.createStreamReader(serializedData).readObject();
    }
378126
@SuppressWarnings("unchecked")
    private T getAttached(T object) {
        if (entityManager.contains(object)) {
            return object;
        } else {
            return findOne((I) entityManager.getEntityManagerFactory()
                    .getPersistenceUnitUtil().getIdentifier(object));
        }
    }
528344
def serialize(cls, obj):
        

        cls._initialize()
        serializer = cls._get_serializer(type(obj))

        if serializer == cls:
            return cls._serialize_default(obj)
        else:
            return serializer.serialize(obj)
475383
def serializable(wrapped):
    

    @wraps(wrapped)
    def wrapper(*args, **kwargs):
        should_serialize = kwargs.pop('serialize', False)
        result = wrapped(*args, **kwargs)

        return serialize(result) if should_serialize else result

    if hasattr(wrapped, 'decorators'):
        wrapper.decorators = wrapped.decorators
        wrapper.decorators.append('serializable')
    else:
        wrapper.decorators = ['serializable']

    return wrapper
439196
@Override
    public boolean isWrapperFor(@SuppressWarnings("rawtypes") Class wrappedType) {
        if (!ServletResponse.class.isAssignableFrom(wrappedType)) {
            throw new IllegalArgumentException("Given class " +
                                               wrappedType.getName() + " not a subinterface of " +
                                               ServletResponse.class.getName());
        }

        final ServletResponse response = getHttpServletResponse();
        @SuppressWarnings("unchecked")
        final Class<? extends ServletResponse> wrappedServletType = wrappedType;

        if (wrappedServletType.isAssignableFrom(response.getClass())) {
            return true;
        } else if (response instanceof ServletResponseWrapper) {
            return ((ServletResponseWrapper) response).isWrapperFor(wrappedType);
        } else {
            return false;
        }
    }
1014102
private static Field getSerialVersionUID(Class<?> clz)
   {
      Class<?> c = clz;
      while (c != null)
      {
         try
         {
            Field svuf = SecurityActions.getDeclaredField(clz, "serialVersionUID");
            SecurityActions.setAccessible(svuf);
            return svuf;
         }
         catch (Throwable t)
         {
            // No serialVersionUID definition
         }
         c = c.getSuperclass();
      }

      return null;
   }
253615
def serialized(func):
    """"""

    @wraps(func)
    def wrapper(*args, **kwargs):
        return '\n'.join(
            ' '.join(parts) if isinstance(parts, tuple) else parts
            for parts in func(*args, **kwargs)
        )

    return wrapper
357113
def append(cls, interceptor):
        
        cls._check(interceptor)
        cls._interceptors.append(interceptor)
829095
private InterceptorMethodKind mapEjbCallbackName(String methodName)
    {
        for (InterceptorMethodKind kind : InterceptorMethodKind.values())
        {
            if (kind.isLifecycle() && methodName.equals(kind.getLifecycleCallbackMethodName()))
            {
                return kind;
            }
        }

        return null;
    }
763093
function serialized(func) {
  var currentPromise = null;
  var wrapped = function() {
    var self = this;
    var args = arguments;
    if (currentPromise) {
      return currentPromise.fin(function() {
        return wrapped.apply(self, args);
      });
    }

    currentPromise = func.apply(self, args);
    
    currentPromise
    .fin(function() {
      currentPromise = null;
    })
    .eat();
    
    return currentPromise;
  };
  return wrapped;
}
788442
def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
        '''
        

        '''
        raise EvaluateException("Unimplemented evaluation", sw.Backtrace(elt))
398770
protected Object wrap(Object object) {
		if (object == null || object instanceof Proxy) {
			return object;
		}
		final Class<?> type = object.getClass();
		return Proxy.newProxyInstance(type.getClassLoader(), type.getInterfaces(), new ProxyHandler(object));
	}
859101
@Override
	public void serializeCollection(BinderContext context, SerializerWrapper serializerWrapper, Collection<E> collection) throws Exception {
		switch (context.getSupportedFormat()) {
		case XML: {
			throw (new KriptonRuntimeException(context.getSupportedFormat() + " context does not support direct collection persistance"));
		}
		default: {
			JacksonWrapperSerializer wrapper = (JacksonWrapperSerializer) serializerWrapper;
			JsonGenerator jacksonGenerator=wrapper.jacksonGenerator;

			try {
				jacksonGenerator.writeStartArray();
				if (context.getSupportedFormat().onlyText)
					for (E object : collection) {
						serializeOnJacksonAsString(object, jacksonGenerator);
					}
				else
					for (E object : collection) {
						serializeOnJackson(object, jacksonGenerator);
					}
				jacksonGenerator.writeEndArray();
			} catch (IOException e) {
				e.printStackTrace();
				throw (new KriptonRuntimeException(e));
			}
		}
			break;
		}
	}
1109225
private static void serializeObject(final Object obj, final ContentHandler handler) throws SAXException {
    if (obj instanceof Map) {
      serializeMap((Map) obj, handler);
    } else if (obj instanceof List) {
      serializeList((List) obj, handler);
    } else if (obj instanceof Number) {
      if (obj instanceof Double || obj instanceof Float) {
        serializeReal((Number) obj, handler);
      } else {
        serializeInteger((Number) obj, handler);
      }
    } else if (obj instanceof Boolean) {
      serializeBoolean((Boolean) obj, handler);
    } else {
      serializeString(String.valueOf(obj), handler);
    }
  }