PageRenderTime 73ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/jboss-5.1.0/server/src/main/org/jboss/invocation/jrmp/server/JRMPInvoker.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 874 lines | 593 code | 111 blank | 170 comment | 28 complexity | 276acdf942522f38b8615baf0f0b7dd2 MD5 | raw file
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2006, Red Hat Middleware LLC, and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.invocation.jrmp.server;
  23. import java.lang.reflect.Method;
  24. import java.net.InetAddress;
  25. import java.net.UnknownHostException;
  26. import java.io.Serializable;
  27. import java.rmi.server.RemoteServer;
  28. import java.rmi.server.UnicastRemoteObject;
  29. import java.rmi.server.RMIServerSocketFactory;
  30. import java.rmi.server.RMIClientSocketFactory;
  31. import java.rmi.server.RemoteStub;
  32. import java.rmi.MarshalledObject;
  33. import java.security.PrivilegedAction;
  34. import java.security.AccessController;
  35. import java.security.PrivilegedExceptionAction;
  36. import java.security.PrivilegedActionException;
  37. import javax.management.ObjectName;
  38. import javax.management.MBeanRegistration;
  39. import javax.management.MBeanServer;
  40. import javax.naming.Name;
  41. import javax.naming.InitialContext;
  42. import javax.naming.Context;
  43. import javax.naming.NamingException;
  44. import javax.naming.NameNotFoundException;
  45. import javax.transaction.Transaction;
  46. import org.jboss.beans.metadata.api.annotations.Create;
  47. import org.jboss.beans.metadata.api.annotations.Destroy;
  48. import org.jboss.beans.metadata.api.annotations.Start;
  49. import org.jboss.beans.metadata.api.annotations.Stop;
  50. import org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy;
  51. import org.jboss.invocation.Invocation;
  52. import org.jboss.invocation.Invoker;
  53. import org.jboss.invocation.MarshalledInvocation;
  54. import org.jboss.invocation.MarshalledValueInputStream;
  55. import org.jboss.kernel.spi.dependency.KernelControllerContext;
  56. import org.jboss.kernel.spi.dependency.KernelControllerContextAware;
  57. import org.jboss.logging.Logger;
  58. import org.jboss.mx.util.JMXExceptionDecoder;
  59. import org.jboss.net.sockets.DefaultSocketFactory;
  60. import org.jboss.security.SecurityDomain;
  61. import org.jboss.system.Registry;
  62. import org.jboss.system.ServiceMBeanSupport;
  63. import org.jboss.tm.TransactionPropagationContextUtil;
  64. /**
  65. * The JRMPInvoker is an RMI implementation that can generate Invocations
  66. * from RMI/JRMP into the JMX base.
  67. *
  68. * @author <a href="mailto:marc.fleury@jboss.org>Marc Fleury</a>
  69. * @author <a href="mailto:scott.stark@jboss.org>Scott Stark</a>
  70. * @version $Revision: 79760 $
  71. * @jmx.mbean extends="org.jboss.system.ServiceMBean"
  72. */
  73. public class JRMPInvoker
  74. extends RemoteServer
  75. implements Invoker, JRMPInvokerMBean, MBeanRegistration, KernelControllerContextAware
  76. {
  77. /** @since 4.2.0 */
  78. static final long serialVersionUID = 3110972460891691492L;
  79. /**
  80. * Identifer to instruct the usage of an anonymous port.
  81. */
  82. public static final int ANONYMOUS_PORT = 0;
  83. /**
  84. * Instance logger.
  85. */
  86. protected Logger log;
  87. /**
  88. * Service MBean support delegate.
  89. */
  90. protected ServiceMBeanSupport support;
  91. /**
  92. * The port the container will be exported on
  93. */
  94. protected int rmiPort = ANONYMOUS_PORT;
  95. /**
  96. * An optional custom client socket factory
  97. */
  98. protected RMIClientSocketFactory clientSocketFactory;
  99. /**
  100. * An optional custom server socket factory
  101. */
  102. protected RMIServerSocketFactory serverSocketFactory;
  103. /**
  104. * The class name of the optional custom client socket factory
  105. */
  106. protected String clientSocketFactoryName;
  107. /**
  108. * The class name of the optional custom server socket factory
  109. */
  110. protected String serverSocketFactoryName;
  111. /**
  112. * The address to bind the rmi port on
  113. */
  114. protected String serverAddress;
  115. /**
  116. * The name of the security domain to use with server sockets that support SSL
  117. */
  118. protected String sslDomain;
  119. protected RemoteStub invokerStub;
  120. /**
  121. * The socket accept backlog
  122. */
  123. protected int backlog = 200;
  124. /**
  125. * A flag to enable caching of classes in the MarshalledValueInputStream
  126. */
  127. protected boolean enableClassCaching = false;
  128. /**
  129. * A priviledged actions for MBeanServer.invoke when running with sec mgr
  130. */
  131. private MBeanServerAction serverAction = new MBeanServerAction();
  132. public JRMPInvoker()
  133. {
  134. final JRMPInvoker delegate = this;
  135. // adapt the support delegate to invoke our state methods
  136. support = new ServiceMBeanSupport(getClass())
  137. {
  138. protected void startService() throws Exception
  139. {
  140. delegate.startService();
  141. }
  142. protected void stopService() throws Exception
  143. {
  144. delegate.stopService();
  145. }
  146. protected void destroyService() throws Exception
  147. {
  148. delegate.destroyService();
  149. }
  150. };
  151. // Setup logging from delegate
  152. log = support.getLog();
  153. }
  154. /**
  155. * @jmx.managed-attribute
  156. */
  157. public int getBacklog()
  158. {
  159. return backlog;
  160. }
  161. /**
  162. * @jmx.managed-attribute
  163. */
  164. public void setBacklog(int back)
  165. {
  166. backlog = back;
  167. }
  168. /**
  169. * @jmx.managed-attribute
  170. */
  171. public boolean getEnableClassCaching()
  172. {
  173. return enableClassCaching;
  174. }
  175. /**
  176. * @jmx.managed-attribute
  177. */
  178. public void setEnableClassCaching(boolean flag)
  179. {
  180. enableClassCaching = flag;
  181. MarshalledValueInputStream.useClassCache(enableClassCaching);
  182. }
  183. /**
  184. * @return The localhost name or null.
  185. */
  186. public String getServerHostName()
  187. {
  188. try
  189. {
  190. return InetAddress.getLocalHost().getHostName();
  191. }
  192. catch (Exception ignored)
  193. {
  194. return null;
  195. }
  196. }
  197. /**
  198. * @jmx.managed-attribute
  199. */
  200. public void setRMIObjectPort(final int rmiPort)
  201. {
  202. this.rmiPort = rmiPort;
  203. }
  204. /**
  205. * @jmx.managed-attribute
  206. */
  207. public int getRMIObjectPort()
  208. {
  209. return rmiPort;
  210. }
  211. /**
  212. * @jmx.managed-attribute
  213. */
  214. public void setRMIClientSocketFactory(final String name)
  215. {
  216. clientSocketFactoryName = name;
  217. }
  218. /**
  219. * @jmx.managed-attribute
  220. */
  221. public String getRMIClientSocketFactory()
  222. {
  223. return clientSocketFactoryName;
  224. }
  225. /**
  226. * @jmx.managed-attribute
  227. */
  228. public void setRMIClientSocketFactoryBean(final RMIClientSocketFactory bean)
  229. {
  230. clientSocketFactory = bean;
  231. }
  232. /**
  233. * @jmx.managed-attribute
  234. */
  235. public RMIClientSocketFactory getRMIClientSocketFactoryBean()
  236. {
  237. return clientSocketFactory;
  238. }
  239. /**
  240. * @jmx.managed-attribute
  241. */
  242. public void setRMIServerSocketFactory(final String name)
  243. {
  244. serverSocketFactoryName = name;
  245. }
  246. /**
  247. * @jmx.managed-attribute
  248. */
  249. public String getRMIServerSocketFactory()
  250. {
  251. return serverSocketFactoryName;
  252. }
  253. /**
  254. * @jmx.managed-attribute
  255. */
  256. public void setRMIServerSocketFactoryBean(final RMIServerSocketFactory bean)
  257. {
  258. serverSocketFactory = bean;
  259. }
  260. /**
  261. * @jmx.managed-attribute
  262. */
  263. public RMIServerSocketFactory getRMIServerSocketFactoryBean()
  264. {
  265. return serverSocketFactory;
  266. }
  267. /**
  268. * @jmx.managed-attribute
  269. */
  270. public void setServerAddress(final String address)
  271. {
  272. serverAddress = address;
  273. }
  274. /**
  275. * @jmx.managed-attribute
  276. */
  277. public String getServerAddress()
  278. {
  279. return serverAddress;
  280. }
  281. /**
  282. * @jmx.managed-attribute
  283. */
  284. public void setSecurityDomain(String domainName)
  285. {
  286. this.sslDomain = domainName;
  287. }
  288. /**
  289. * @jmx.managed-attribute
  290. */
  291. public String getSecurityDomain()
  292. {
  293. return sslDomain;
  294. }
  295. public Serializable getStub()
  296. {
  297. return this.invokerStub;
  298. }
  299. protected void startService() throws Exception
  300. {
  301. loadCustomSocketFactories();
  302. log.debug("RMI Port='" +
  303. (rmiPort == ANONYMOUS_PORT ? "Anonymous" :
  304. Integer.toString(rmiPort)) + "'");
  305. log.debug("Client SocketFactory='" +
  306. (clientSocketFactory == null ? "Default" :
  307. clientSocketFactory.toString()) + "'");
  308. log.debug("Server SocketFactory='" +
  309. (serverSocketFactory == null ? "Default" :
  310. serverSocketFactory.toString()) + "'");
  311. log.debug("Server SocketAddr='" +
  312. (serverAddress == null ? "Default" :
  313. serverAddress) + "'");
  314. log.debug("SecurityDomain='" +
  315. (sslDomain == null ? "Default" :
  316. sslDomain) + "'");
  317. InitialContext ctx = new InitialContext();
  318. // Validate that there is a TransactionPropagationContextImporter
  319. // bound in JNDI
  320. TransactionPropagationContextUtil.getTPCImporter();
  321. // Set the transaction manager and transaction propagation
  322. // context factory of the GenericProxy class
  323. Invoker delegateInvoker = createDelegateInvoker();
  324. // Make the remote invoker proxy available for use by the proxy factory
  325. Registry.bind(support.getServiceName(), delegateInvoker);
  326. // Export CI
  327. exportCI();
  328. log.debug("Bound JRMP invoker for JMX node");
  329. ctx.close();
  330. }
  331. protected void stopService() throws Exception
  332. {
  333. InitialContext ctx = new InitialContext();
  334. try
  335. {
  336. unexportCI();
  337. }
  338. finally
  339. {
  340. ctx.close();
  341. }
  342. this.clientSocketFactory = null;
  343. this.serverSocketFactory = null;
  344. this.invokerStub = null;
  345. }
  346. protected void destroyService() throws Exception
  347. {
  348. // Export references to the bean
  349. Registry.unbind(support.getServiceName());
  350. }
  351. /**
  352. * Invoke a Remote interface method.
  353. */
  354. public Object invoke(Invocation invocation)
  355. throws Exception
  356. {
  357. ClassLoader oldCl = TCLAction.UTIL.getContextClassLoader();
  358. ObjectName mbean = null;
  359. try
  360. {
  361. // Deserialize the transaction if it is there
  362. MarshalledInvocation mi = (MarshalledInvocation) invocation;
  363. invocation.setTransaction(importTPC(mi.getTransactionPropagationContext()));
  364. mbean = (ObjectName) Registry.lookup(invocation.getObjectName());
  365. // The cl on the thread should be set in another interceptor
  366. Object obj = serverAction.invoke(mbean,
  367. "invoke",
  368. new Object[]{invocation},
  369. Invocation.INVOKE_SIGNATURE);
  370. return new MarshalledObject(obj);
  371. }
  372. catch (Exception e)
  373. {
  374. Throwable th = JMXExceptionDecoder.decode(e);
  375. if (log.isTraceEnabled())
  376. log.trace("Failed to invoke on mbean: " + mbean, th);
  377. if (th instanceof Exception)
  378. e = (Exception) th;
  379. throw e;
  380. }
  381. finally
  382. {
  383. TCLAction.UTIL.setContextClassLoader(oldCl);
  384. Thread.interrupted(); // clear interruption because this thread may be pooled.
  385. }
  386. }
  387. protected Invoker createDelegateInvoker()
  388. {
  389. return new JRMPInvokerProxy(this);
  390. }
  391. protected void exportCI() throws Exception
  392. {
  393. this.invokerStub = (RemoteStub) UnicastRemoteObject.exportObject
  394. (this, rmiPort, clientSocketFactory, serverSocketFactory);
  395. }
  396. protected void unexportCI() throws Exception
  397. {
  398. UnicastRemoteObject.unexportObject(this, true);
  399. }
  400. protected void rebind(Context ctx, String name, Object val)
  401. throws NamingException
  402. {
  403. // Bind val to name in ctx, and make sure that all
  404. // intermediate contexts exist
  405. Name n = ctx.getNameParser("").parse(name);
  406. while (n.size() > 1)
  407. {
  408. String ctxName = n.get(0);
  409. try
  410. {
  411. ctx = (Context) ctx.lookup(ctxName);
  412. }
  413. catch (NameNotFoundException e)
  414. {
  415. ctx = ctx.createSubcontext(ctxName);
  416. }
  417. n = n.getSuffix(1);
  418. }
  419. ctx.rebind(n.get(0), val);
  420. }
  421. /**
  422. * Load and instantiate the clientSocketFactory, serverSocketFactory using
  423. * the TCL and set the bind address and SSL domain if the serverSocketFactory
  424. * supports it.
  425. */
  426. protected void loadCustomSocketFactories()
  427. {
  428. ClassLoader loader = TCLAction.UTIL.getContextClassLoader();
  429. if( clientSocketFactory == null )
  430. {
  431. try
  432. {
  433. if (clientSocketFactoryName != null)
  434. {
  435. Class csfClass = loader.loadClass(clientSocketFactoryName);
  436. clientSocketFactory = (RMIClientSocketFactory) csfClass.newInstance();
  437. }
  438. }
  439. catch (Exception e)
  440. {
  441. log.error("Failed to load client socket factory", e);
  442. clientSocketFactory = null;
  443. }
  444. }
  445. if( serverSocketFactory == null )
  446. {
  447. try
  448. {
  449. if (serverSocketFactoryName != null)
  450. {
  451. Class ssfClass = loader.loadClass(serverSocketFactoryName);
  452. serverSocketFactory = (RMIServerSocketFactory) ssfClass.newInstance();
  453. if (serverAddress != null)
  454. {
  455. // See if the server socket supports setBindAddress(String)
  456. try
  457. {
  458. Class[] parameterTypes = {String.class};
  459. Method m = ssfClass.getMethod("setBindAddress", parameterTypes);
  460. Object[] args = {serverAddress};
  461. m.invoke(serverSocketFactory, args);
  462. }
  463. catch (NoSuchMethodException e)
  464. {
  465. log.warn("Socket factory does not support setBindAddress(String)");
  466. // Go with default address
  467. }
  468. catch (Exception e)
  469. {
  470. log.warn("Failed to setBindAddress=" + serverAddress + " on socket factory", e);
  471. // Go with default address
  472. }
  473. }
  474. /* See if the server socket supports setSecurityDomain(SecurityDomain)
  475. if an sslDomain was specified
  476. */
  477. if (sslDomain != null)
  478. {
  479. try
  480. {
  481. InitialContext ctx = new InitialContext();
  482. SecurityDomain domain = (SecurityDomain) ctx.lookup(sslDomain);
  483. Class[] parameterTypes = {SecurityDomain.class};
  484. Method m = ssfClass.getMethod("setSecurityDomain", parameterTypes);
  485. Object[] args = {domain};
  486. m.invoke(serverSocketFactory, args);
  487. }
  488. catch (NoSuchMethodException e)
  489. {
  490. log.error("Socket factory does not support setSecurityDomain(SecurityDomain)");
  491. }
  492. catch (Exception e)
  493. {
  494. log.error("Failed to setSecurityDomain=" + sslDomain + " on socket factory", e);
  495. }
  496. }
  497. }
  498. // If a bind address was specified create a DefaultSocketFactory
  499. else if (serverAddress != null)
  500. {
  501. DefaultSocketFactory defaultFactory = new DefaultSocketFactory(backlog);
  502. serverSocketFactory = defaultFactory;
  503. try
  504. {
  505. defaultFactory.setBindAddress(serverAddress);
  506. }
  507. catch (UnknownHostException e)
  508. {
  509. log.error("Failed to setBindAddress=" + serverAddress + " on socket factory", e);
  510. }
  511. }
  512. }
  513. catch (Exception e)
  514. {
  515. log.error("operation failed", e);
  516. serverSocketFactory = null;
  517. }
  518. }
  519. }
  520. /**
  521. * Import a transaction propagation context into the local VM, and
  522. * return the corresponding <code>Transaction</code>.
  523. *
  524. * @return A transaction or null if no tpc.
  525. */
  526. protected Transaction importTPC(Object tpc)
  527. {
  528. if (tpc != null)
  529. return TransactionPropagationContextUtil.importTPC(tpc);
  530. return null;
  531. }
  532. //
  533. // Delegate the ServiceMBean details to our support delegate
  534. //
  535. public String getName()
  536. {
  537. return support.getName();
  538. }
  539. public MBeanServer getServer()
  540. {
  541. return support.getServer();
  542. }
  543. public int getState()
  544. {
  545. return support.getState();
  546. }
  547. public String getStateString()
  548. {
  549. return support.getStateString();
  550. }
  551. public void create() throws Exception
  552. {
  553. support.create();
  554. }
  555. public void start() throws Exception
  556. {
  557. support.start();
  558. }
  559. public void stop()
  560. {
  561. support.stop();
  562. }
  563. public void destroy()
  564. {
  565. support.destroy();
  566. }
  567. public void jbossInternalLifecycle(String method) throws Exception
  568. {
  569. support.jbossInternalLifecycle(method);
  570. }
  571. public ObjectName preRegister(MBeanServer server, ObjectName name)
  572. throws Exception
  573. {
  574. return support.preRegister(server, name);
  575. }
  576. public void postRegister(Boolean registrationDone)
  577. {
  578. support.postRegister(registrationDone);
  579. }
  580. public void preDeregister() throws Exception
  581. {
  582. support.preDeregister();
  583. }
  584. public void postDeregister()
  585. {
  586. support.postDeregister();
  587. }
  588. public void setKernelControllerContext(KernelControllerContext context) throws Exception
  589. {
  590. support.setKernelControllerContext(context);
  591. }
  592. public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
  593. {
  594. support.unsetKernelControllerContext(context);
  595. }
  596. @Create
  597. public void pojoCreate() throws Exception
  598. {
  599. support.pojoCreate();
  600. }
  601. @Start
  602. public void pojoStart() throws Exception
  603. {
  604. support.pojoStart();
  605. }
  606. @Stop
  607. public void pojoStop() throws Exception
  608. {
  609. support.pojoStop();
  610. }
  611. @Destroy
  612. public void pojoDestroy() throws Exception
  613. {
  614. support.pojoDestroy();
  615. }
  616. interface TCLAction
  617. {
  618. class UTIL
  619. {
  620. static TCLAction getTCLAction()
  621. {
  622. return System.getSecurityManager() == null ? NON_PRIVILEGED : PRIVILEGED;
  623. }
  624. static ClassLoader getContextClassLoader()
  625. {
  626. return getTCLAction().getContextClassLoader();
  627. }
  628. static ClassLoader getContextClassLoader(Thread thread)
  629. {
  630. return getTCLAction().getContextClassLoader(thread);
  631. }
  632. static void setContextClassLoader(ClassLoader cl)
  633. {
  634. getTCLAction().setContextClassLoader(cl);
  635. }
  636. static void setContextClassLoader(Thread thread, ClassLoader cl)
  637. {
  638. getTCLAction().setContextClassLoader(thread, cl);
  639. }
  640. }
  641. TCLAction NON_PRIVILEGED = new TCLAction()
  642. {
  643. public ClassLoader getContextClassLoader()
  644. {
  645. return Thread.currentThread().getContextClassLoader();
  646. }
  647. public ClassLoader getContextClassLoader(Thread thread)
  648. {
  649. return thread.getContextClassLoader();
  650. }
  651. public void setContextClassLoader(ClassLoader cl)
  652. {
  653. Thread.currentThread().setContextClassLoader(cl);
  654. }
  655. public void setContextClassLoader(Thread thread, ClassLoader cl)
  656. {
  657. thread.setContextClassLoader(cl);
  658. }
  659. };
  660. TCLAction PRIVILEGED = new TCLAction()
  661. {
  662. private final PrivilegedAction getTCLPrivilegedAction = new PrivilegedAction()
  663. {
  664. public Object run()
  665. {
  666. return Thread.currentThread().getContextClassLoader();
  667. }
  668. };
  669. public ClassLoader getContextClassLoader()
  670. {
  671. return (ClassLoader) AccessController.doPrivileged(getTCLPrivilegedAction);
  672. }
  673. public ClassLoader getContextClassLoader(final Thread thread)
  674. {
  675. return (ClassLoader) AccessController.doPrivileged(new PrivilegedAction()
  676. {
  677. public Object run()
  678. {
  679. return thread.getContextClassLoader();
  680. }
  681. });
  682. }
  683. public void setContextClassLoader(final ClassLoader cl)
  684. {
  685. AccessController.doPrivileged(new PrivilegedAction()
  686. {
  687. public Object run()
  688. {
  689. Thread.currentThread().setContextClassLoader(cl);
  690. return null;
  691. }
  692. });
  693. }
  694. public void setContextClassLoader(final Thread thread, final ClassLoader cl)
  695. {
  696. AccessController.doPrivileged(new PrivilegedAction()
  697. {
  698. public Object run()
  699. {
  700. thread.setContextClassLoader(cl);
  701. return null;
  702. }
  703. });
  704. }
  705. };
  706. ClassLoader getContextClassLoader();
  707. ClassLoader getContextClassLoader(Thread thread);
  708. void setContextClassLoader(ClassLoader cl);
  709. void setContextClassLoader(Thread thread, ClassLoader cl);
  710. }
  711. /**
  712. * Perform the MBeanServer.invoke op in a PrivilegedExceptionAction if
  713. * running with a security manager.
  714. */
  715. class MBeanServerAction implements PrivilegedExceptionAction
  716. {
  717. private ObjectName target;
  718. String method;
  719. Object[] args;
  720. String[] sig;
  721. MBeanServerAction()
  722. {
  723. }
  724. MBeanServerAction(ObjectName target, String method, Object[] args, String[] sig)
  725. {
  726. this.target = target;
  727. this.method = method;
  728. this.args = args;
  729. this.sig = sig;
  730. }
  731. public Object run() throws Exception
  732. {
  733. Object rtnValue = support.getServer().invoke(target, method, args, sig);
  734. return rtnValue;
  735. }
  736. Object invoke(ObjectName target, String method, Object[] args, String[] sig)
  737. throws Exception
  738. {
  739. SecurityManager sm = System.getSecurityManager();
  740. Object rtnValue = null;
  741. if (sm == null)
  742. {
  743. // Direct invocation on MBeanServer
  744. rtnValue = support.getServer().invoke(target, method, args, sig);
  745. }
  746. else
  747. {
  748. try
  749. {
  750. // Encapsulate the invocation in a PrivilegedExceptionAction
  751. MBeanServerAction action = new MBeanServerAction(target, method, args, sig);
  752. rtnValue = AccessController.doPrivileged(action);
  753. }
  754. catch (PrivilegedActionException e)
  755. {
  756. Exception ex = e.getException();
  757. throw ex;
  758. }
  759. }
  760. return rtnValue;
  761. }
  762. }
  763. }