1 | <?php |
||
45 | class RemoteProxy implements RemoteObjectInterface |
||
46 | { |
||
47 | |||
48 | /** |
||
49 | * Holds the ContextSession for this proxy. |
||
50 | * |
||
51 | * @var \AppserverIo\RemoteMethodInvocation\SessionInterface |
||
52 | */ |
||
53 | protected $session = null; |
||
54 | |||
55 | /** |
||
56 | * The class name to proxy. |
||
57 | * |
||
58 | * @var string $className |
||
59 | */ |
||
60 | protected $className = null; |
||
61 | |||
62 | /** |
||
63 | * Initializes the proxy with the class name to proxy. |
||
64 | * |
||
65 | * @param mixed $className The name of the class to create the proxy for |
||
66 | */ |
||
67 | public function __construct($className = 'AppserverIo\Appserver\Core\InitialContext') |
||
71 | |||
72 | /** |
||
73 | * The name of the original object. |
||
74 | * |
||
75 | * @return string The name of the original object |
||
76 | * @see \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getClassName() |
||
77 | */ |
||
78 | public function __getClassName() |
||
82 | |||
83 | /** |
||
84 | * Sets the session with the connection instance. |
||
85 | * |
||
86 | * @param \AppserverIo\RemoteMethodInvocation\SessionInterface $session The session instance to use |
||
87 | * |
||
88 | * @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The instance itself |
||
89 | */ |
||
90 | public function __setSession(SessionInterface $session) |
||
95 | |||
96 | /** |
||
97 | * Returns the session instance. |
||
98 | * |
||
99 | * @return \AppserverIo\RemoteMethodInvocation\SessionInterface The session instance |
||
100 | * @see \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getSession() |
||
101 | */ |
||
102 | public function __getSession() |
||
106 | |||
107 | /** |
||
108 | * Invokes the remote execution of the passed remote method. |
||
109 | * |
||
110 | * @param string $method The remote method to call |
||
111 | * @param array $params The parameters for the method call |
||
112 | * |
||
113 | * @return mixed The result of the remote method call |
||
114 | */ |
||
115 | public function __call($method, $params) |
||
123 | |||
124 | /** |
||
125 | * Invokes the remote execution of the passed remote method. |
||
126 | * |
||
127 | * @param \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface $methodCall The remote method call instance |
||
128 | * @param \AppserverIo\RemoteMethodInvocation\SessionInterface $session The session with the connection instance to use |
||
129 | * |
||
130 | * @return mixed The result of the remote method call |
||
131 | */ |
||
132 | public function __invoke(RemoteMethodInterface $methodCall, SessionInterface $session) |
||
136 | |||
137 | /** |
||
138 | * Factory method to create a new instance of the requested proxy implementation. |
||
139 | * |
||
140 | * @param string $className The name of the class to create the proxy for |
||
141 | * |
||
142 | * @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance |
||
143 | */ |
||
144 | public static function __create($className) |
||
148 | } |
||
149 |