Index: xotcl/library/actiweb/WebAgent.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r435b41481fb51bf000ebe736d8574fefbeec1710 --- xotcl/library/actiweb/WebAgent.xotcl (.../WebAgent.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/actiweb/WebAgent.xotcl (.../WebAgent.xotcl) (revision 435b41481fb51bf000ebe736d8574fefbeec1710) @@ -1,51 +1,61 @@ -# $Id: WebAgent.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +# $Id: WebAgent.xotcl,v 1.2 2005/09/09 21:07:23 neumann Exp $ + package provide xotcl::actiweb::webAgent 0.8 package require xotcl::actiweb::agent package require xotcl::actiweb::invoker package require xotcl::mixinStrategy -# -# Web Agent are special agents that allow us to define another -# object in the paramter webfacade as a facade for the web agent -# itself and the sub-system shielded by the web agent with an interface -# for agents -# -Class WebAgent -superclass Agent +package require XOTcl -WebAgent instproc init args { - next -} +namespace eval ::xotcl::actiweb::webAgent { + namespace import ::xotcl::* -# -# let the web agents facade handle the call -> interprete args -# as "method args" -# return result of the invoker -# -#WebAgent instproc invokeFacade {args} { -# set a "" -# set m "" -# set l [llength $args] -# set o [my webfacade] -# if {$l > 0} { -# set m [lindex $args 0] -# } -# if {$l > 1} { -# set a [lrange $args 1 end] -# } -# -# #puts stderr "Web Agent [self]->invoke: OBJ: $o PROC: $m ARGS: $a" -# -# # -# # tell the invoker to redirect the call to the webfacade object -# # -# set re [RedirectException [self]::[my autoname re] \ -\# -obj $o -method $m -arguments $a] -# -# return $re -#} - + # + # Web Agent are special agents that allow us to define another + # object in the paramter webfacade as a facade for the web agent + # itself and the sub-system shielded by the web agent with an interface + # for agents + # + Class WebAgent -superclass Agent -#WebAgent instproc default args { -# return [next] -#} + WebAgent instproc init args { + next + } + + # + # let the web agents facade handle the call -> interprete args + # as "method args" + # return result of the invoker + # + #WebAgent instproc invokeFacade {args} { + # set a "" + # set m "" + # set l [llength $args] + # set o [my webfacade] + # if {$l > 0} { + # set m [lindex $args 0] + # } + # if {$l > 1} { + # set a [lrange $args 1 end] + # } + # + # #puts stderr "Web Agent [self]->invoke: OBJ: $o PROC: $m ARGS: $a" + # + # # + # # tell the invoker to redirect the call to the webfacade object + # # + # set re [RedirectException [self]::[my autoname re] \ + # -obj $o -method $m -arguments $a] + # + # return $re + #} + + #WebAgent instproc default args { + # return [next] + #} + + namespace export WebAgent +} + +namespace import ::xotcl::actiweb::webAgent::*