springpython.remoting.hessian.hessianlib (version 0.1)
index
/home/gturnquist/spring-python-1.1.x/src/springpython/remoting/hessian/hessianlib.py

# A Hessian client interface for Python.  The date and long types require
# Python 2.2 or later.
#
# The Hessian proxy is used as follows:
#
# proxy = Hessian("http://hessian.caucho.com/test/basic")
#
# print proxy.hello()
#
# --------------------------------------------------------------------
#
# The Apache Software License, Version 1.1
#
# Copyright (c) 2001-2002 Caucho Technology, Inc.  All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in
#    the documentation and/or other materials provided with the
#    distribution.
#
# 3. The end-user documentation included with the redistribution, if
#    any, must include the following acknowlegement:
#       "This product includes software developed by the
#        Caucho Technology (http://www.caucho.com/)."
#    Alternately, this acknowlegement may appear in the software itself,
#    if and wherever such third-party acknowlegements normally appear.
#
# 4. The names "Hessian", "Resin", and "Caucho" must not be used to
#    endorse or promote products derived from this software without prior
#    written permission. For written permission, please contact
#    [email protected].
#
# 5. Products derived from this software may not be called "Resin"
#    nor may "Resin" appear in their names without prior written
#    permission of Caucho Technology.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED.  IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# --------------------------------------------------------------------
#
# Credits: hessianlib.py was inspired and partially based on
# xmlrpclib.py created by Fredrik Lundh at www.pythonware.org
#

 
Modules
       
string
time
urllib

 
Classes
       
Binary
Boolean
Date
Error
Fault
ProtocolError
Hessian
HessianParser
HessianWriter

 
class Binary
     Methods defined here:
__init__(self, data=None)

 
class Boolean
    Boolean -- use the True or False constants
 
  Methods defined here:
__init__(self, value=0)
__int__(self)
__nonzero__(self)
__repr__(self)

 
class Date
    Date - wraps a time value in seconds
 
  Methods defined here:
__init__(self, value=0)
__repr__(self)

 
class Error
    

 
class Fault(Error)
     Methods defined here:
__init__(self, code, message, **detail)
# Represents a fault from Hessian
__repr__(self)

 
class Hessian
    Represents a remote object reachable by Hessian
 
  Methods defined here:
__getattr__(self, name)
__init__(self, url)
__repr__(self)
__str__ = __repr__(self)
parse_response(self, f)

 
class HessianParser
    # Parses the results from the server
 
  Methods defined here:
__init__(self, f)
error(self)
parse_length(self)
parse_object(self)
parse_object_code(self, code)
parse_reply(self)
parse_string(self)
parse_type(self)
read(self, len)

 
class HessianWriter
    HessianWriter - writes Hessian data from Python objects
 
  Methods defined here:
write_call(self, method, params)
write_double(self, value)
write_instance(self, value)
write_int(self, value)
write_list(self, value)
write_long(self, value)
write_map(self, value)
write_object(self, value)
write_reference(self, value)
write_string(self, value)

Data and other attributes defined here:
dispatch = {<type 'instance'>: <function write_instance>, <type 'float'>: <function write_double>, <type 'int'>: <function write_int>, <type 'list'>: <function write_list>, <type 'long'>: <function write_long>, <type 'dict'>: <function write_map>, <type 'str'>: <function write_string>, <type 'tuple'>: <function write_list>}

 
class ProtocolError(Error)
     Methods defined here:
__init__(self, url, code, message, headers)
# Represents an HTTP protocol error
__repr__(self)

 
Functions
       
pack(...)
Return string containing values v1, v2, ... packed according to fmt.
unpack(...)
Unpack the string containing packed C structure data, according to fmt.
Requires len(string) == calcsize(fmt).

 
Data
        False = <False at b7c4d4ec>
StringTypes = (<type 'str'>, <type 'unicode'>)
True = <True at b7bfe5ac>
__version__ = '0.1'