1 /* |
1 /* |
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
137 return lowWaterMark; |
136 return lowWaterMark; |
138 } |
137 } |
139 |
138 |
140 // todo: equals implementation |
139 // todo: equals implementation |
141 public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { |
140 public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { |
|
141 checkMethod(method); |
|
142 |
142 Object result; |
143 Object result; |
143 try { |
144 try { |
144 result = method.invoke(this, args); |
145 result = method.invoke(this, args); |
145 } catch (InvocationTargetException e) { |
146 } catch (InvocationTargetException e) { |
146 throw e.getTargetException(); |
147 throw e.getTargetException(); |
147 } catch (Exception e) { |
148 } catch (Exception e) { |
148 throw new RuntimeException("unexpected invocation exception: " + |
149 throw new RuntimeException("unexpected invocation exception: " + |
149 e.getMessage()); |
150 e.getMessage()); |
150 } finally { |
|
151 } |
151 } |
152 return result; |
152 return result; |
153 } |
153 } |
154 |
154 |
155 } |
155 } |