'Jelly an object according to the remote security rules for this broker.
@param object: The object to jelly.
@param perspective: The perspective.
@param method: The method.
@param args: Arguments.
@param kw: Keyword arguments.'

def serialize(self, object, perspective=None, method=None, args=None, kw=None):

    if isinstance(object, defer.Deferred):
        object.addCallbacks(self.serialize, (lambda x: x), callbackKeywords={'perspective': perspective, 'method': method, 'args': args, 'kw': kw})
        return object
    self.serializingPerspective = perspective
    self.jellyMethod = method
    self.jellyArgs = args
    self.jellyKw = kw
    try:
        return jelly(object, self.security, None, self)
    finally:
        self.serializingPerspective = None
        self.jellyMethod = None
        self.jellyArgs = None
        self.jellyKw = None
