Example usage for java.security PrivilegedActionException getException

List of usage examples for java.security PrivilegedActionException getException

Introduction

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

Prototype

public Exception getException() 

Source Link

Document

Returns the exception thrown by the privileged computation that resulted in this PrivilegedActionException .

Usage

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public String addComment(final String resourcePath, final org.wso2.carbon.registry.api.Comment comment)
        throws RegistryException {
    try {//from ww w.ja  va2 s .c  o  m
        return AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                return addCommentInternal(resourcePath, comment);
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void editComment(final String commentPath, final String text) throws RegistryException {
    try {//from  www  .jav a2  s. co  m
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                editCommentInternal(commentPath, text);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void removeComment(final String commentPath) throws RegistryException {
    try {/*from  w  w  w.  j a  v a 2s  .  c om*/
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                removeCommentInternal(commentPath);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void rateResource(final String resourcePath, final int rating) throws RegistryException {
    try {//from  ww w . j  a v a 2s .c o m
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                rateResourceInternal(resourcePath, rating);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

@SuppressWarnings("rawtypes")
public Collection executeQuery(final String path, final Map parameters) throws RegistryException {
    try {//from   w w  w .  java 2s.  c om
        return AccessController.doPrivileged(new PrivilegedExceptionAction<Collection>() {
            @Override
            public Collection run() throws Exception {
                return executeQueryInternal(path, parameters);
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public LogEntry[] getLogs(final String resourcePath, final int action, final String userName, final Date from,
        final Date to, final boolean recentFirst) throws RegistryException {
    try {//w  w  w .  j  a v  a2s .  c  o  m
        return AccessController.doPrivileged(new PrivilegedExceptionAction<LogEntry[]>() {
            @Override
            public LogEntry[] run() throws Exception {
                return getLogsInternal(resourcePath, action, userName, from, to, recentFirst);
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void associateAspect(final String resourcePath, final String aspect) throws RegistryException {
    try {/*w  w w . j  av a  2s  . c  o  m*/
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                associateAspectInternal(resourcePath, aspect);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void createLink(final String path, final String target) throws RegistryException {
    try {//  w  w  w  . j  ava 2  s .  co  m
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                createLinkInternal(path, target);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void removeLink(final String path) throws RegistryException {
    try {/*from   www. j  a v a  2s. c  o  m*/
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                removeLinkInternal(path);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}

From source file:org.wso2.carbon.registry.core.session.UserRegistry.java

public void restore(final String path, final Reader reader) throws RegistryException {
    try {//from   ww  w. j  a v  a  2s.  co m
        AccessController.doPrivileged(new PrivilegedExceptionAction<String>() {
            @Override
            public String run() throws Exception {
                restoreInternal(path, reader);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw (RegistryException) e.getException();
    }
}