You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by di...@apache.org on 2009/03/12 01:23:34 UTC
svn commit: r752702 [4/8] - in /incubator/etch/trunk/binding-python: ./
compiler/ compiler/src/main/java/etch/ compiler/src/main/java/etch/bindings/
compiler/src/main/java/etch/bindings/python/
compiler/src/main/java/etch/bindings/python/compiler/ comp...
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,47 @@
+"""
+Etch.Support.Validator_int
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+import types
+from etch.support.TypeValidator import *
+from etch.transport.fmt.TypeCode import *
+from etch.util.Exceptions import *
+from etch.util.Types import *
+
+class Validator_int(NumberTypeValidator):
+ """
+ Validator for int
+ """
+
+ def __init__(self, nDims):
+ """
+ Construct the validator.
+
+ @param nDims the number of dimensions. 0 or scalar.
+ """
+ typs = [Integer]
+ super(Validator_int,self).__init__(typs, None, nDims, "int[%d]" % nDims, Integer, [TypeCode.INTS, TypeCode.INT])
+
+ def checkValue(self, value):
+ tc = super(Validator_int,self).checkValue(value)
+
+ if tc == TypeCode.INT:
+ if value >= Byte.MIN_VALUE and value <= Byte.MAX_VALUE:
+ return TypeCode.BYTE
+ if value >= Short.MIN_VALUE and value <= Short.MAX_VALUE:
+ return TypeCode.SHORT
+ return tc
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_int.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,48 @@
+"""
+Etch.Support.Validator_long
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+import types
+from etch.support.TypeValidator import *
+from etch.transport.fmt.TypeCode import *
+from etch.util.Exceptions import *
+from etch.util.Types import *
+
+class Validator_long(NumberTypeValidator):
+ """
+ Validator for long
+ """
+
+ def __init__(self, nDims):
+ """
+ Construct the validator.
+
+ @param nDims the number of dimensions. 0 or scalar.
+ """
+ typs = [Long]
+ super(Validator_long,self).__init__(typs, None, nDims, "long[%d]" % nDims, Long, [TypeCode.LONGS, TypeCode.LONG])
+
+ def checkValue(self, value):
+ tc = super(Validator_long,self).checkValue(value)
+ if tc == TypeCode.LONG:
+ if value >= Byte.MIN_VALUE and value <= Byte.MAX_VALUE:
+ return TypeCode.BYTE
+ if value >= Short.MIN_VALUE and value <= Short.MAX_VALUE:
+ return TypeCode.SHORT
+ if value >= Integer.MIN_VALUE and value <= Integer.MAX_VALUE:
+ return TypeCode.INT
+ return tc
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_long.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,42 @@
+"""
+etch.support.Validator_object
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from etch.msg.TypeValidator import *
+from etch.transport.fmt.TypeCode import TypeCode
+
+class Validator_object(ScalarOnlyTypeValidator):
+ """
+ Validator for object
+ """
+ validator = None
+
+ @classmethod
+ def get(cls, nDims):
+
+ if cls.validator == None:
+ cls.validator = cls()
+ return cls.validator
+
+ def elementValidator():
+ return self
+
+ def validate(self, value):
+ return True
+
+ def checkValue(self, value):
+ return TypeCode.ANY
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_object.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,46 @@
+"""
+Etch.Support.Validator_short
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+import types
+from etch.support.TypeValidator import *
+from etch.transport.fmt.TypeCode import *
+from etch.util.Exceptions import *
+from etch.util.Types import *
+
+class Validator_short(NumberTypeValidator):
+ """
+ Validator for short
+ """
+
+ def __init__(self, nDims):
+ """
+ Construct the validator.
+
+ @param nDims the number of dimensions. 0 or scalar.
+ """
+ typs = [Short]
+ super(Validator_short,self).__init__(typs, None, nDims, "short[%d]" % nDims, Short, [TypeCode.SHORTS, TypeCode.SHORT])
+
+ def checkValue(self, value):
+ tc = super(Validator_short, self).checkValue(value)
+
+ if tc == TypeCode.SHORT:
+ if value >= Byte.MIN_VALUE and value <= Byte.MAX_VALUE:
+ return TypeCode.BYTE
+ return tc
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_short.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,43 @@
+"""
+Etch.Support.Validator_string
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+import types
+from etch.support.TypeValidator import *
+from etch.transport.fmt.TypeCode import TypeCode
+from etch.util.Exceptions import *
+from etch.util.Types import *
+
+class Validator_string(ScalarAndArrayTypeValidator):
+
+ def __init__(self, nDims):
+ """
+ Construct the validator.
+
+ @param nDims the number of dimensions. 0 or scalar.
+ """
+ typs = [String,types.StringType,types.UnicodeType]
+ super(Validator_string,self).__init__(typs, None, nDims, "string[%d]" % nDims, False, TypeCode.STRING)
+
+ def checkValue(self, value):
+ tc = super(Validator_string,self).checkValue(value)
+
+ # Override with EMPTY_STRING if len(value) == 0
+ if tc == TypeCode.STRING:
+ if len(value) == 0:
+ tc = TypeCode.EMPTY_STRING
+ return tc
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_string.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,40 @@
+"""
+etch.support.Validator_void
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+
+from etch.msg.TypeValidator import *
+from etch.transport.fmt.TypeCode import TypeCode
+
+class Validator_void(ScalarOnlyTypeValidator):
+ """
+ Validator for void
+ """
+
+ def __init__(self):
+ self.description = 'void'
+
+ def elementValidator(self):
+ return None
+
+ def validate(self, value):
+ return value == None
+
+ def checkValue(self, value):
+ if self.validate(value):
+ return TypeCode.NULL
+ return None
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/Validator_void.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,26 @@
+"""
+$Id: _Etch_AuthException.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ..support._Etch_RuntimeException import *
+
+__all__ = ["_Etch_AuthException"]
+
+class _Etch_AuthException(_Etch_RuntimeException):
+ serialVersionUID = -5541931265968145750L
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_AuthException.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,35 @@
+"""
+$Id: _Etch_RuntimeException.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+
+__all__ = ["_Etch_RuntimeException"]
+
+class _Etch_RuntimeException(Exception):
+ serialVersionUID = 3051515541923877063L
+
+ def __init__(self, args=None):
+ super(_Etch_RuntimeException,self).__init__(args)
+ self.__message = args
+
+ def getMessage(self):
+ return self.__message
+
+ def __repr__(self):
+ return "Remote side threw this runtime exception: %s" % self.__message
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/_Etch_RuntimeException.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,55 @@
+"""
+$Id: __init__.py 712748 2008-08-17 05:58:09Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from .AuthExceptionSerializer import *
+from .Class2TypeMap import *
+from .DefaultServerFactory import *
+from .DefaultValueFactory import *
+from .DeliveryService import *
+from .DummyValueFactory import *
+from .FreePool import *
+from .Mailbox import *
+from .NullPool import *
+from .ObjSession import *
+from .Pool import *
+from .QueuedPool import *
+from .RemoteBase import *
+from .RuntimeExceptionSerializer import *
+from .ServerFactory import *
+from .StubBase import *
+from .StubHelper import *
+from .StubIntf import *
+from .TransportFactory import *
+from .TransportHelper import *
+from .TypeValidator import *
+from .Validator_boolean import *
+from .Validator_byte import *
+from .Validator_custom import *
+from .Validator_double import *
+from .Validator_float import *
+from .Validator_long import *
+from .Validator_object import *
+from .Validator_RuntimeException import *
+from .Validator_short import *
+from .Validator_string import *
+from .Validator_StructValue import *
+from .Validator_void import *
+from ._Etch_AuthException import *
+from ._Etch_RuntimeException import *
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/support/__init__.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,117 @@
+"""
+$Id: ArrayValue.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ...python.Exceptions import *
+from ..msg.Type import *
+
+class ArrayValue(object):
+ """
+ An array of values, where each value is of arbitrary type
+ chosen from the basic python/etch type: Boolean, Byte, Short,
+ Integer, Long, Float, Double, String and array of those, the
+ extended type ArrayValue and StructValue, and specific types
+ supported by ValueFactory.
+
+ ArrayValue is not protected against concurrent access.
+ """
+
+ def __init__(self, array, typeCode=0, customStructType=None, dim=0):
+ """
+ Constructs the ArrayValue
+
+ @param array
+ @param dim
+ @param customStructType
+ @param typeCode
+ """
+ if array == None:
+ raise NullPointerException, "array == None"
+
+ if not isinstance(array, [types.ListType, types.TupleType]):
+ raise IllegalArgumentException, "array is not a list or tuple"
+
+ self.__array = list(array)
+ self.__typeCode = typeCode
+ self.__customStructType = customStructType
+ self.__dim = dim
+ self.__addIndex = 0
+
+ def typeCode(self):
+ """
+ @return the TypeCode for this array value
+ """
+ return self.__typeCode
+
+ def customStructType(self):
+ """
+ @return a struct type if a custom type code
+ """
+ return self.__customStructType
+
+ def dim(self):
+ """
+ @return the dimensionality of the array
+ """
+ return self.__dim
+
+ def __iter__(self):
+ return self.__array.__iter__()
+
+ def size(self):
+ """
+ Alias for len(self)
+ """
+ returns self.__len__()
+
+ def __len__(self):
+ """
+ @return the number of elements in the array
+ """
+ return len(self.__array)
+
+ def __getitem__(self, idx):
+ """
+ @param idx
+ @return the element at the specified index
+ """
+ return self.__array[idx]
+
+ def compact(self):
+ """
+ Reallocates the array so that it is only as long as needed.
+ """
+ if self.__addIndex == self.size():
+ return
+
+ self.__array = self.__array[0:self.__addIndex]
+
+ def add(self, value):
+ """
+ Adds the value to the end of the array
+
+ @param value
+ """
+ self.__array[self.__addIndex] = value
+ self.__addIndex += 1
+
+ def getArray(self):
+ """
+ @return the array value
+ """
+ return self.__array
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/ArrayValue.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,141 @@
+"""
+$Id: DefaultDeliveryService.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ..msg.Message import *
+from ..msg.Type import *
+from ..support.DeliveryService import *
+from ..support.Mailbox import *
+from ...util.Monitor import *
+from ...util.Resources import *
+from ...util.TimeoutException import *
+from ...util.URL import *
+from ...util.core.Who import *
+
+
+class DefaultDeliveryService(DeliveryService):
+ """
+ Default implementation of DeliveryService
+ """
+
+ DISABLE_TIMEOUT = "DefaultDeliveryService.disableTimeout"
+ """Parameter to Globally Disable Timeout."""
+
+ def __init__(self, transport, uri, resources):
+ """
+ @param transport
+ @param uri
+ @param resources
+ """
+ self.__transport = transport
+ self.__session = None
+ self.__status = Monitor("session status")
+ u = URL(uri)
+ self.__transport.setSession(self)
+ self.__disableTimeout = u.getBooleanTerm(self.DISABLE_TIMEOUT, False)
+
+ def getTransport(self):
+ """
+ @return the transport
+ """
+ return self.__transport
+
+ def getSession(self):
+ return self.__session
+
+ def sessionQuery(self, query):
+ return self.__session.sessionQuery(query)
+
+ def sessionControl(self, control, value):
+ self.__sessionControl(control, value)
+
+ def sessionNotify(self, event):
+ if event == self.UP:
+ self.__status.set(self.UP)
+ elif event == self.DOWN:
+ self.__status.set(self.DOWN)
+
+ self.__session.sessionNotify(event)
+
+ def sessionMessage(self, sender, msg):
+ return self.__session.sessionMessage(sender, msg)
+
+ def __repr__(self):
+ return self.__transport.__repr__()
+
+ def waitUp(self, maxDelay):
+ self.__status.waitUntilEq(self.UP, maxDelay)
+
+ def waitDown(self, maxDelay):
+ self.__status.waitUntilEq(self.DOWN, maxDelay)
+
+ def transportMessage(self, recipient, msg):
+ self.__transport.transportMessage(recipient, msg)
+
+ def transportQuery(self, query):
+ #TODO - where are WaitUp and WaitDown defined?
+ if query.__class__ == WaitUp:
+ self.waitUp(query.maxDelay)
+ return None
+ elif query.__class__ == WaitDown:
+ self.waitDown(query.maxDelay)
+ return None
+ else:
+ return self.__transport.transportQuery(query)
+
+ def transportControl(self, control, value):
+ if control == self.START_AND_WAIT_UP:
+ self.__transport.transportControl(self.START, None)
+ self.waitUp(value)
+ elif control == self.STOP_AND_WAIT_DOWN:
+ self.__transport.transportControl(self.STOP, None)
+ self.waitDown(value)
+ else:
+ self.__transport.transportControl(control, value)
+
+ def transportNotify(self, event):
+ self.__transport.transportNotify(event)
+
+ def beginCall(self, msg):
+ try:
+ return self.__transport.transportCall(None, msg)
+ except:
+ # TODO - more detail in raise?
+ raise Exception, "unexpected exception sending message"
+
+ def endCall(self, mb, responseType):
+ try:
+ timeout = 0
+ if not self.__disableTimeout:
+ timeout = responseType.getTimeout()
+
+ mbe = mb.read(timeout)
+ if mbe == None:
+ raise TimeoutException, "timeout waiting for %s" % repr(responseType)
+
+ rmsg = mbe.msg
+ rmsg.checkType(responseType)
+ r = rmsg.get(responseType.getResponseField())
+ if isinstance(r, Exception):
+ raise r
+ return r
+ finally:
+ mb.closeDelivery()
+
+
+
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/DefaultDeliveryService.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,93 @@
+"""
+$Id: FormatFactory.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ..msg.ValueFactory import *
+from ...python.Exceptions import *
+from ...python.SynchronizedMap import *
+
+__all__ = ['FormatFactory']
+
+default_FormatFactories = {
+ 'binary' : 'etch.transport.fmt.binary.BinaryTaggedDataFormatFactory'
+}
+
+class FormatFactory(object):
+ """
+ A factory used to construct tagged data processors for messagizer
+ """
+
+ formatFactories = SynchronizedMap(default_FormatFactories) # TODO: needs to be a synchronized Map
+
+ def newTaggedDataInput(self, vf, uri):
+ """
+ @param vf
+ @param uri
+ @return the tagged data input with the specified value factory and
+ initialized by terms from the uri
+ """
+ raise AbstractMethodException
+
+ def newTaggedDataOutput(self, vf, uri):
+ """
+ @param vf
+ @param uri
+ @return the tagged data output with the specified value factory and
+ initialized by the terms of the uri
+ """
+ raise AbstractMethodException
+
+ @classmethod
+ def get(cls,name):
+ """
+ Gets the named format factory.
+
+ @param name the name of a configured format factory
+ @return the named format factory, or None if it isn't defined
+ """
+ factory = cls.formatFactories.get(name, None)
+ if factory == None:
+ return None
+
+ factoryInstance = None
+ if isinstance(factory, types.StringTypes):
+ try:
+ # TODO: module lookup ?
+ exec("factoryInstance = %s()" % factory)
+ except:
+ raise IllegalArgumentException, "Could not create instance of format name %s: %s" % (name, sys.exc_info()[1])
+ else:
+ factoryInstance = factory
+
+ if isinstance(factoryInstance, FormatFactory):
+ return factoryInstance
+ else:
+ raise IllegalArgumentException "instance for format name %s(%s) does not implement FormatFactory" % (name, repr(factory))
+
+
+ @classmethod
+ def put(cls, name, factory):
+ """
+ Puts a named format factory into the dictionary.
+
+ @param name the name of the format factory (e.g. 'binary').
+ @param factory the name of the fully qualified class name or instance
+ of the FormatFactory to associate with the name.
+ """
+ cls.formatFactories[name] = factory
+
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/FormatFactory.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,63 @@
+"""
+$Id: MailboxManager.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ...python.Exceptions import *
+from ..msg.Message import *
+from ..support.DeliveryService import *
+from ..support.Mailbox import *
+from ...util.core.Who import *
+
+class MailboxManager(SessionMessage,TransportMessage):
+ """
+ Interface to the mailbox manager as needed by DeliveryService and Mailbox implementors
+ """
+
+ def transportCall(self, recipient, msg):
+ """
+ Sends a message which begins a call after allocating a Mailbox to receive any responses
+
+ @param recipient specifies the recipient when there is the possibility of more than one
+ @param msg the message which begins the call
+ @return the mailbox which will receive responses to this call
+ """
+ raise UndefinedInterfaceMethodException
+
+ def unregister(self, mb):
+ """
+ Removes the mailbox from the set of mailboxes receiving responses to messages.
+ @param mb a mailbox as returned by 'transportCall(Who, Message)
+ """
+ raise UndefinedInterfaceMethodException
+
+ def redeliver(self, sender, msg):
+ """
+ Re-delivers dead letter message from a closed mailbox
+
+ @param sender
+ @param msg
+ """
+ raise UndefinedInterfaceMethodException
+
+
+
+
+
+
+
+
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/MailboxManager.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,156 @@
+"""
+$Id: Messagizer.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from __future__ import with_statement
+from .MessagizerMessageSource import *
+from .FormatFactory import *
+from ..msg.Message import *
+from ..msg.ValueFactory import *
+from ...util.FlexBuffer import *
+from ...util.Resources import *
+from ...util.URL import *
+from ...util.core.Who import *
+from ...util.core.io.PacketHandler import *
+from ...util.core.io.PacketSource import *
+from ...python.Exceptions import *
+from ...python.SynchronizeOn import *
+
+class Messagizer(PacketHandler,MessagizerMessageSource):
+ """
+ Messagizer is a PacketHandler which accepts packets from a PacketSource and
+ turns them into messages for delivery to a MessageHandler. Messagizer is
+ also a MessageSource, accepting messages and turning them into packets for
+ delivery to a PacketSource.
+ """
+
+ FORMAT = "Messagizer.format"
+ """
+ Name of format name in uri or resources. The value is "Messagizer.format".
+ The result of looking up this name should be a String.
+
+ @see #Messagizer(String, Resources)
+ """
+
+ VALUE_FACTORY = "Messagizer.valueFactory"
+ """
+ Name of value factory in resources. The value is "Messagizer.valueFactory".
+ The result of looking up this name should be a {@link ValueFactory} fo the
+ service.
+
+ @see #Messagizer(String, Resources)
+ """
+
+ def __init__(self, uri, resources):
+ """
+ Constructs the Messagizer with NULL handler and tagged data format
+ constructed from the format factory.
+
+ @param uri - the uri being used to configure the transport stack
+ @param resources - the associated set of resources for this service
+ """
+ # Parse 'uri' string
+ uri = URL(uri)
+
+ # Find the format
+ format = uri.getTerm(Messagizer.FORMAT)
+ if format == None:
+ format = resources.get(Messagizer.FORMAT)
+ if format == None:
+ raise IllegalArgumentException, "Format name is not defined as '%s' in uri or resources" % Messagizer.FORMAT
+
+ # Find the format factory
+ ff = FormatFactory.get(format)
+ if ff == None:
+ raise IllegalArgumentException, "Format factory is not defined as '%s' in format factories" % format
+
+ # Find the value factory
+ vf = resources.get(Messagizer.VALUE_FACTORY)
+ if vf == None:
+ raise IllegalArgumentException, "Value factory is not defined as '%s' in resources" % Messsagizer.VALUE_FACTORY
+
+ # Construct the message formatters
+ self.__tdi = ff.newTaggedDataInput(vf, repr(uri))
+ self.__tdo = ff.newTaggedDataOutput(vf, repr(uri))
+
+ # Other inits
+ self.__src = None
+ self.__msgBuf = FlexBuffer()
+ self.__handler = None
+
+ def __repr__(self):
+ return "Messagizer/%s" % self.__src
+
+ def packet(self, sender, buf):
+ # messagize the packet
+ msg = self.__tdi.readMessage(buf)
+ # Log.report("Messagizer.packet", "who", self, "recv", msg)
+ self.__handler.message(sender, msg)
+
+ ## Message Source
+
+ def messagex(self, recipient, msg):
+
+ # packetize the message
+ with SynchronizeOn(self.__msgBuf):
+ try:
+ # Log.report("Messagizer.packet", "who", self, "send", msg)
+ # assert that msgBuf is reset
+ # leave space for packet header
+ self.__msgBuf.skip(self.__src.headerSize(), True)
+ self.__tdo.writeMessage(msg, self.__msgBuf)
+ self.__msgBuf.setIndex(0)
+ self.__src.packet(recipient, self.__msgBuf)
+ finally:
+ self.__msgBuf.reset()
+
+ ## SourceHandler methods
+
+ def getSource(self):
+ return self.__src
+
+ def setSource(self, src):
+ self.__src = src
+
+ def sessionQuery(self, query):
+ return self.__handler.sessionQuery(query)
+
+ def sessionControl(self, control, value):
+ self.__handler.sessionControl(control, value)
+
+ def sessionNotify(self, event):
+ self.__handler.sessionNotify(event)
+
+ ## Source methods
+
+ def getHandler(self):
+ return self.__handler
+
+ def setHandler(self, handler):
+ self.__handler = handler
+ self.__handler.setSource(self)
+
+ def transportQuery(self, query):
+ return self.__src.transportQuery(query)
+
+ def transportControl(self, control, value):
+ self.__src.transportControl(control, value)
+
+ def transportNotify(self, event):
+ self.__src.transportNotify(event)
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/Messagizer.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,196 @@
+"""
+$Id: PlainMailbox.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from __future__ import with_statement
+from ..msg.Message import *
+from ..support.Mailbox import * # Mailbox and MailboxElement
+from ...util.AlarmListener import *
+from ...util.AlarmManager import *
+from ...util.CircularQueue import *
+from ...python.SynchronizedOn import *
+from ...python.Exceptions import *
+
+class PlainMailbox(Mailbox, AlarmListener):
+ """
+ A plain implementation of a mailbox using a fixed size circular queue
+ """
+
+ def __init__(self, mailboxManager, messageId, maxMessageDelay, lifetime, maxMessages):
+ """
+ Constructs the Mailbox
+
+ @param mailboxManager - the mailbox manager to use to unregister this mailbox
+ and to deliver undelivered messages.
+ @param messageId
+ @param maxMessageDelay - the maximum delay in milliseconds to wait when trying
+ to put a message in the mailbox.
+ @param lifetime - the time in milliseconds to keep the mailbox open. Lifetime
+ of 0 means to keep it open until explicitly closed.
+ @param maxMessages
+ """
+ if mailboxManager == None:
+ raise NullPointerException, "mailboxManager cannot be None"
+
+ if messageId == None:
+ raise NullPointerException, "messageId cannot be None"
+
+ if lifetime < 0:
+ raise IllegalArgumentException, "lifetime < 0"
+
+ if maxMessages < 1:
+ raise IllegalArgumentException, "maxMessages < 1"
+
+ self.__mailboxManager = mailboxManager
+ self.__messageId = messageId
+ self.__maxMessageDelay = maxMessageDelay
+ self.__lifetime = lifetime
+ self.__maxMessages = maxMessages
+
+ self.__queue = CircularQueue(maxMessages)
+
+ self.__alarmSet = False
+ self.__notify = None
+ self.__state = None
+ if lifetime > 0:
+ self.__alarmSet = True
+ AlarmManager.staticAdd(self, None, self.__lifetime)
+
+ def getMailboxManager(self):
+ """
+ @return - the mailboxManager of this mailbox
+ """
+ return self.__mailboxManager
+
+ def getMessageId(self):
+ return self.__messageId
+
+ def getMaxMessageDelay(self):
+ """
+ @return - the maxMessageDelay of this mailbox
+ """
+ return self.__maxMessageDelay
+
+ def getLifetime(self):
+ """
+ @return - the lifetime of this mailbox
+ """
+ return self.__lifetime
+
+ def getMaxMessages(self):
+ """
+ @return - the maxMessages of this mailbox
+ """
+ return self.__maxMessages
+
+ # TODO: original signature 'boolean message(Who sender, Message msg)
+ def queueMessage(self, sender, msg):
+ ok = self.__queue.put(MailboxElement(sender, msg), maxMessageDelay)
+ if ok:
+ self.fireNotify()
+ return ok
+
+ def fireNotify(self):
+ with SynchronizedOn(self.__queue):
+ n = self.__notify
+ s = self.__state
+ c = self.__queue.isClosed()
+
+ if n != None:
+ n.mailboxStatus(self, s, c)
+
+ def read(self, maxDelay=None):
+ return self.__queue.get(maxDelay)
+
+ def closeDelivery(self):
+ with SynchronizedOn(self.__queue):
+ if self.__queue.isClosed():
+ return False
+
+ if self.__alarmSet:
+ self.__alarmSet = False
+ AlarmManager.staticRemove(self)
+
+ self.__mailboxManager.unregister(self)
+ self.__queue.close()
+
+ self.fireNotify()
+ return True
+
+ def closeRead(self):
+
+ if closeDelivery():
+ mbe = self.read()
+ while mbe != None:
+ self.__mailboxManager.redeliver(mbe.sender, mbe.msg)
+ mbe = self.read()
+ return True
+ return False
+
+ def wakeup(self, manager, state, due):
+ self.closeDelivery()
+ return 0
+
+ def registerNotify(self, notify, state, maxDelay):
+ if notify == None:
+ raise NullPointerException, "Notify == None"
+
+ if maxDelay < 0:
+ raise IllegalArgumentException, "maxDelay < 0"
+
+ if self.__notify != None:
+ raise IllegalStateException, "self.__notify != None"
+
+ isNotEmptyOrIsClosed = False
+ with SynchronizedOn(self.__queue):
+ self.__notify = notify
+ self.__state = state
+
+ if maxDelay > 0:
+ self.__alarmSet = True
+ AlarmManager.staticAdd(self, None, maxDelay)
+
+ isNotEmptyOrIsClosed = not self.__queue.isEmpty() or self.__queue.isClosed()
+
+ if isNotEmptyOrIsClosed:
+ self.fireNotify()
+
+ def unregisterNotify(self, notify):
+ if notify == None:
+ raise NullPointerException, "notify == None"
+
+ if notify != self.__notify:
+ raise IllegalStateException, "notify != self.__notify"
+
+ with SynchronizedOn(self.__queue):
+ if self.__alarmSet:
+ self.__alarmSet = False
+ AlarmManager.staticRemove(self)
+
+ self.__notify = None
+ self.__state = None
+
+ def isEmpty(self):
+ return self.__queue.isEmpty()
+
+ def isClosed(self):
+ return self.__queue.isClosed()
+
+ def isFull(self):
+ return self.__isFull()
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailbox.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,204 @@
+"""
+$Id: PlainMailboxManager.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from __future__ import with_statement
+from ...python.SynchronizedOn import *
+from ...python.SynchronizedMap import *
+from ...python.Exceptions import *
+from .MailboxManager import *
+from ..msg.Message import *
+from ..support.Mailbox import *
+from ...util.IdGenerator import *
+from ...util.Resources import *
+from ...util.URL import *
+from ...util.core.Who import *
+from ...util.core.io.Session import *
+
+class PlainMailboxManager(MailboxManager):
+ """
+ MailboxManager is a MessageHandler which accepts packets for possible delivery to a mailbox, or
+ to another message handler if an appropriate mailbox cannot be found. MailboxManager is also a
+ MessageSource, tagging messages with msgIds and then forwarding them to another MessageSource.
+ If requested, a mailbox is created with a message's msgid and added to the set of mailboxes waiting
+ for messages.
+ """
+
+ def __init__(self, transport, uri, resources):
+ """
+ @param transport used to deliver messages to our peer
+ @param uri
+ @param resources
+ """
+ self.__transport = transport
+ self.__session = None
+ self.__up = False
+ self.__mailboxes = SynchronizedMap()
+
+ # TODO - change 'seed'
+ self.__idGen = IdGenerator('seed', 37)
+ self.__transport.setSession(self)
+
+ def getTransport(self):
+ """
+ @return the transport
+ """
+ return self.__transport
+
+ def __repr__(self):
+ return "PlainMailboxManager/%s" % repr(self.__transport)
+
+ ####
+ # MessageHandler Methods
+ ####
+
+ def sessionMessage(self, sender, msg):
+ msgid = msg.getInReplyTo()
+ if msgid != None:
+ mb = self.getMailbox(msgid)
+ if mb != None:
+ try:
+ return mb.message(sender, msg)
+ except InterruptedException:
+ # timeout or mailbox closed .. fall through
+ pass
+ # no such mailbox .. reject
+ return False
+ # no msgid .. pass of to session
+ return self.__session.sessionMessage(sender, msg)
+
+ ####
+ # MessageSource Methods
+ ####
+
+ def transportMessage(self, recipient, msg):
+ if msg.getMessageId() != None:
+ raise IllegalStateException, "message has already been sent"
+
+ msg.setMessageId(self.__idGen.next())
+
+ self.__transport.transportMessage(recipient, msg)
+
+ def transportCall(self, recipient, msg):
+ if msg.getMessageId() != None:
+ raise IllegalStateException, "message has already been sent"
+
+ if msg.getInReplyTo() != None:
+ raise IllegalStateException, "message is marked as a reply"
+
+ msgid = self.__idGen.next()
+ msg.setMessageId(msgid)
+
+ mb = PlainMailbox(self, msgid)
+ self.register(mb)
+
+ try:
+ self.__transport.transportMessage(recipient, msg)
+ except:
+ self.unregister(mb)
+ raise Exception
+
+ return mb
+
+ ####
+ # Mailbox methods
+ ####
+
+ def register(self, mb):
+ """
+ Adds a mailbox to the set of mailbox receiving responses to messages.
+ @param mb
+ """
+ msgid = mb.getMessageId()
+ with SynchronizedOn(self.__mailboxes):
+ if not self.__up:
+ raise IllegalStateException, "connection down"
+
+ if msgid in self.__mailboxes.keys():
+ raise IllegalArgumentException, "duplicate msgid in mailboxes"
+
+ self.__mailboxes[msgid] = mb
+
+
+ def unregister(self, mb):
+ del self.__mailboxes[mb.getMessageId()]
+
+ def unregisterAll(self):
+ for mb in self.__mailboxes.values():
+ mb.closeDelivery()
+
+ def getMailbox(self, msgid):
+ """
+ Returns the mailbox for the specified msgid. *This is a testing api*
+ @param msgid
+ @return the mailbox for the specified msgid
+ """
+ return self.__mailboxes[msgid]
+
+ def redeliver(self, sender, msg):
+ self.__session.sessionMessage(sender, msg)
+
+ def size(self)::
+ """
+ @return the number of mailboxes
+ """
+ return len(self.__mailboxes)
+
+ ####
+ # SourceHandler methods
+ ####
+
+ def sessionQuery(self, query):
+ return self.__session.sessionQuery(query)
+
+ def sessionControl(self, control, value):
+ self.__session.sessionControl(control, value)
+
+ def sessionNotify(self, event):
+ if event == Session.UP:
+ self.__up = True
+ elif event == Session.DOWN:
+ self.__up = False
+ self.unregisterAll()
+ self.__session.sessionNotify(event)
+
+ ####
+ # Source methods
+ ####
+
+ def transportQuery(self, query):
+ return self.__transport.transportQuery(query)
+
+ def transportControl(self, control, value):
+ self.__transport.transportControl(control, value)
+
+ def transportNotify(self, event):
+ self.__transport.transportNotify(event)
+
+ def getSession(self):
+ return self.__session
+
+ def setSession(self, session):
+ self.__session = session
+
+
+
+
+
+
+
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/PlainMailboxManager.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,38 @@
+"""
+$Id: SessionMessage.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ..msg.Message import *
+from ...util.core.Who import *
+from ...util.core.io.Session import *
+
+class SessionMessage(Session):
+ """
+ Interface used to deliver messages to the session from the transport.
+ """
+
+ def sessionMessage(self, sender, msg):
+ """
+ Delivers data to the session from the transport.
+
+ @param sender the sender of the message, for transport which allow multiple sends. This is who
+ to return the response to.
+ @param msg a Message
+ @return true if the message was consumed, false otherwise
+ """
+ raise UndefinedInterfaceMethodException
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/SessionMessage.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,36 @@
+"""
+$Id: TaggedDataInput.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ..msg.Message import *
+from ...python.Exceptions import *
+
+class TaggedDataInput(object):
+ """
+ A TaggedDataInput reads type tagged values from an input buffer.
+ """
+
+ def readMessage(self, buf):
+ """
+ Reads a message from the buffer.
+
+ @param buf - the FlexBuffer containing the message
+ @return - a message read from the buffer
+ @raise IOException
+ """
+ raise UndefinedInterfaceMethodException
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataInput.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,35 @@
+"""
+$Id: TaggedDataOutput.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ...python.Exceptions import *
+
+class TaggedDataOutput:
+ """
+ A TaggedDataOutput writes type tagged data values to an output buffer
+ """
+
+ def writeMessage(self, msg, buf):
+ """
+ Writes the message to the buffer.
+
+ @param msg - the message to be written
+ @param buf - the buffer to write to
+ @raises IOException
+ """
+ raise UndefinedInterfaceMethodException
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TaggedDataOutput.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,106 @@
+"""
+$Id: TcpTransportFactory.py 712747 2008-08-16 21:53:35Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from .TransportFactory import *
+from .MailboxManager import *
+from .Messagizer import *
+from .DefaultDeliveryService import *
+from ..support.DeliveryService import *
+from ...util.Resources import *
+from ...util.core.io.Listener import *
+from ...util.core.io.ListenerHandler import *
+from ...util.core.io.Packetizer import *
+from ...util.core.io.Session import *
+from ...util.core.io.TcpConnection import *
+from ...util.core.io.Transport import *
+from ...python.Exceptions import *
+
+__all__ = ['TcpTransportFactory']
+
+class _ListenerHandler(ListenerHandler):
+
+ def __init__(self, transportFactory, uri, resources, serverFactory):
+ super(_ListenerHandler,self).__init__()
+ self.__transportFactory = transportFactory
+ self.__uri = uri
+ self.__resources = resources
+ self.__serverFactory = serverFactory
+
+ self.__src = None
+
+ def accepted(self, s)::
+ r = Resources(self.__resources)
+ r.put('SOCKET', s)
+
+ d = self.__transportFactory.newTransport(self.__uri, r)
+ self.__serverFactory.newServer(d)
+ d.transportControl(Transport.START, None)
+
+ def getSource(self):
+ return self.__src
+
+ def setSource(self, src):
+ self.__src = src
+
+ def sessionQuery(self, query):
+ if isinstance(self.__serverFactory, Session):
+ return self.__serverFactory.sessionQuery(query)
+ else:
+ raise UnsupportedOperationException, "unknown query %s" % query
+
+ def sessionControl(self, control, value):
+ if isinstance(self.__serverFactory, Session):
+ self.__serverFactory.sessionControl(control, value)
+ else:
+ raise UnsupportedOperationException, "unknown control %s" % query
+
+ def sessionNotify(self, event):
+ if isinstance(self.__ServerFactory, Session):
+ self.__serverFactory.sessionQuery(event)
+
+
+class TcpTransportFactory(TransportFactory):
+ """
+ Transport factory for tcp
+ """
+
+ def newTransport(self, uri, resources):
+
+ socket = resources.get("SOCKET")
+
+ c = TcpConnection(uri, resources, socket)
+ p = Packetizer(uri, resources)
+ c.setHandler(p)
+ m = Messagizer(uri, resources)
+ p.setHandler(m)
+ r = MailboxManager(uri, resources)
+ m.setHandler(r)
+ d = DefaultDeliveryService(uri, resources)
+ r.setHandler(d)
+
+ return d
+
+ def newListener(self, uri, resources, factory):
+ lh = _ListenerHandler()
+ l = Listener(uri)
+ l.setHandler(lh)
+ return l
+
+
+
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TcpTransportFactory.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,37 @@
+"""
+$Id: TransportMessage.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ...python.Exceptions import *
+from ..msg.Message import *
+from ...util.core.Who import *
+from ...util.core.io.Transport import *
+
+class TransportMessage(Transport):
+ """
+ Interface used to deliver messages to the transport from the session
+ """
+
+ def transportMessage(self, recipient, msg):
+ """
+ Delivers the data to the transport.
+
+ @param recipient specifies the recipient when there is the possibility of more than one.
+ @param msg the Message
+ """
+ raise UndefinedInterfaceMethodException
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/TransportMessage.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,41 @@
+"""
+$Id: UnwantedMessage.py 712749 2008-08-18 03:26:52Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from ...python.Exceptions import *
+from ..msg.Message import *
+from ...util.core.Who
+
+class UnwantedMessage(object):
+ """
+ Event class used with sessionNotify to report unwanted messages.
+ """
+
+ def __init__(self, sender, msg):
+ """
+ Constructs the UnwantedMessage.
+
+ @param sender
+ @param msg
+ """
+ self.__sender = sender
+ self.__msg = msg
+
+ def __repr__(self):
+ return "Unwanted message from %s: %s" % (repr(self.__sender), repr(self.__msg)
+
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/UnwantedMessage.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,37 @@
+"""
+$Id: __init__.py 712748 2008-08-17 05:58:09Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from .ArrayValue import *
+from .DefaultDeliveryService import *
+from .FormatFactory import *
+from .MailboxManager import *
+from .Messagizer import *
+from .PlainMailbox import *
+from .PlainMailboxManager import *
+from .SessionMessage import *
+from .TaggedDataInput import *
+from .TaggedDataOutput import *
+from .TcpTransportFactory import *
+from .TransportMessage import *
+from .UnwantedMessage import *
+
+#from .fmt import *
+#from .filters import *
+import fmt
+import filters
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py
------------------------------------------------------------------------------
svn:executable = *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/__init__.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/AbstractMessageFilter.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/AbstractMessageFilter.py?rev=752702&view=auto
==============================================================================
(empty)
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/AbstractMessageFilter.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/AbstractMessageFilter.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/KeepAlive.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/KeepAlive.py?rev=752702&view=auto
==============================================================================
(empty)
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/KeepAlive.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/KeepAlive.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/Logger.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/Logger.py?rev=752702&view=auto
==============================================================================
(empty)
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/Logger.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/Logger.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/PwAuth.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/PwAuth.py?rev=752702&view=auto
==============================================================================
(empty)
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/PwAuth.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/PwAuth.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py?rev=752702&view=auto
==============================================================================
--- incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py (added)
+++ incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py Thu Mar 12 00:23:28 2009
@@ -0,0 +1,23 @@
+"""
+$Id: __init__.py 712748 2008-08-17 05:58:09Z dixson3 $
+
+# Copyright 2007-2008 Cisco Systems Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy
+# of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+"""
+from __future__ import absolute_import
+from .AbstractMessageFilter import *
+from .KeepAlive import *
+from .Logger import *
+from .PwAuth import *
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-python/runtime/src/main/python/etch/binding/transport/filters/__init__.py
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"