Example usage for java.security PrivilegedActionException getMessage

List of usage examples for java.security PrivilegedActionException getMessage

Introduction

In this page you can find the example usage for java.security PrivilegedActionException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.java

/**
 * Load and Return a Definition object./* ww  w . j  av  a2 s.  c  o m*/
 * (The caller will determine if the Definition object should have 
 * its resources freed or not)
 * @return Definition
 * @throws WSDLException
 */
private Definition loadDefinition() throws WSDLException {

    Definition def = null;

    if (wsdlExplicitURI != null) {
        try {
            def = (Definition) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                public Object run() throws WSDLException {
                    WSDLReader reader = getWSDLReader();
                    return reader.readWSDL(wsdlExplicitURI);
                }
            });
        } catch (PrivilegedActionException e) {
            if (isDebugEnabled) {
                log.debug(myClassName + ".loadDefinition(): " + "Exception thrown from AccessController: " + e);
                log.trace("Call Stack = " + JavaUtils.callStackToString());
            }
            WSDLException we = new WSDLException("WSDLWrapperReloadImpl : ", e.getMessage(), e);
            throw we;
        }
    }

    // Loading the wsdl is expensive.  Dump the callstack.. so that we 
    // support can look at the trace and determine if this class is being used incorrectly.
    if (isDebugEnabled) {
        log.debug(myClassName + ".loadDefinition():  returning Definition [" + def + "]");
        log.trace("Call Stack = " + JavaUtils.callStackToString());
    }
    return def;
}

From source file:org.apache.myfaces.ov2021.application.jsp.JspStateManagerImpl.java

protected Object deserializeView(Object state) {
    if (log.isLoggable(Level.FINEST))
        log.finest("Entering deserializeView");

    if (state instanceof byte[]) {
        if (log.isLoggable(Level.FINEST))
            log.finest("Processing deserializeView - deserializing serialized state. Bytes : "
                    + ((byte[]) state).length);

        try {/* ww  w  . j a  va2s .  com*/
            ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) state);
            InputStream is = bais;
            if (is.read() == COMPRESSED_FLAG) {
                is = new GZIPInputStream(is);
            }
            ObjectInputStream ois = null;
            try {
                final ObjectInputStream in = new MyFacesObjectInputStream(is);
                ois = in;
                Object object = null;
                if (System.getSecurityManager() != null) {
                    object = AccessController.doPrivileged(new PrivilegedExceptionAction<Object[]>() {
                        public Object[] run()
                                throws PrivilegedActionException, IOException, ClassNotFoundException {
                            return new Object[] { in.readObject(), in.readObject() };
                        }
                    });
                } else {
                    object = new Object[] { in.readObject(), in.readObject() };
                }
                return object;
            } finally {
                if (ois != null) {
                    ois.close();
                    ois = null;
                }
            }
        } catch (PrivilegedActionException e) {
            log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(),
                    e);
            return null;
        } catch (IOException e) {
            log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(),
                    e);
            return null;
        } catch (ClassNotFoundException e) {
            log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(),
                    e);
            return null;
        }
    } else if (state instanceof Object[]) {
        if (log.isLoggable(Level.FINEST))
            log.finest("Exiting deserializeView - state not serialized.");

        return state;
    } else if (state == null) {
        log.severe("Exiting deserializeView - this method should not be called with a null-state.");
        return null;
    } else {
        log.severe("Exiting deserializeView - this method should not be called with a state of type : "
                + state.getClass());
        return null;
    }
}

From source file:org.codice.ddf.registry.federationadmin.service.impl.RefreshRegistrySubscriptions.java

private void createRemoteEntries(List<Metacard> remoteMetacardsToCreate) throws FederationAdminException {
    try {/*from  w  ww  .  jav a2  s .c o m*/
        Security.runAsAdminWithException(
                () -> federationAdminService.addRegistryEntries(remoteMetacardsToCreate, null));
    } catch (PrivilegedActionException e) {
        throw new FederationAdminException(e.getMessage());
    }
}