Package org.jboss.security.vault

Examples of org.jboss.security.vault.SecurityVault


        createVault(fqn, null, options);
    }

    protected void createVault(final String fqn, final String module, final Map<String, Object> options) throws VaultReaderException {
        Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
        SecurityVault vault = null;
        try {
            vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {
                @Override
                public SecurityVault run() throws Exception {
                    if (fqn == null || fqn.isEmpty()) {
                        return SecurityVaultFactory.get();
                    } else if (module == null ){
                        return SecurityVaultFactory.get(fqn);
                    } else {
                        return SecurityVaultFactory.get(getModuleClassLoader(module), fqn);
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            Throwable t = e.getCause();
            if (t instanceof SecurityVaultException) {
                throw SecurityLogger.ROOT_LOGGER.vaultReaderException(t);
            }
            if (t instanceof RuntimeException) {
                throw SecurityLogger.ROOT_LOGGER.runtimeException(t);
            }
            throw SecurityLogger.ROOT_LOGGER.runtimeException(t);
        }
        try {
            vault.init(vaultOptions);
        } catch (SecurityVaultException e) {
            throw SecurityLogger.ROOT_LOGGER.vaultReaderException(e);
        }
        this.vault = vault;
    }
View Full Code Here


  protected SecurityVault vault;

  public void createVault(final String fqn, final Map<String, Object> options) throws VaultReaderException {
    Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
    SecurityVault vault = null;
    try {
      vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {

        @Override
        public SecurityVault run() throws Exception {
          if (fqn == null || fqn.isEmpty()) {
            return SecurityVaultFactory.get();
          } else {
            return SecurityVaultFactory.get(fqn);
          }
        }
      });
    } catch (PrivilegedActionException e) {
      Throwable t = e.getCause();
      if (t instanceof SecurityVaultException) {
        throw SecurityLogger.ROOT_LOGGER.vaultReaderException(t);
      }
      if (t instanceof RuntimeException) {
        throw SecurityLogger.ROOT_LOGGER.runtimeException(t);
      }
      throw SecurityLogger.ROOT_LOGGER.runtimeException(t);
    }
    try {
      vault.init(vaultOptions);
    } catch (SecurityVaultException e) {
      e.printStackTrace();
      throw SecurityLogger.ROOT_LOGGER.vaultReaderException(e);
    }
    this.vault = vault;
View Full Code Here

    public RuntimeVaultReader() {
    }

    protected void createVault(final String fqn, final Map<String, Object> options) throws VaultReaderException {
        Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
        SecurityVault vault = null;
        try {
            vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {
                @Override
                public SecurityVault run() throws Exception {
                    if (fqn == null || fqn.isEmpty()) {
                        return SecurityVaultFactory.get();
                    } else {
                        return SecurityVaultFactory.get(fqn);
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            Throwable t = e.getCause();
            if (t instanceof SecurityVaultException) {
                throw SecurityMessages.MESSAGES.vaultReaderException(t);
            }
            if (t instanceof RuntimeException) {
                throw SecurityMessages.MESSAGES.runtimeException(t);
            }
            throw SecurityMessages.MESSAGES.runtimeException(t);
        }
        try {
            vault.init(vaultOptions);
        } catch (SecurityVaultException e) {
            throw SecurityMessages.MESSAGES.vaultReaderException(e);
        }
        this.vault = vault;
    }
View Full Code Here

    protected RuntimeVaultReader() {
    }

    void createVault(final String fqn, final Map<String, Object> options) throws SecurityVaultException {
        Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
        SecurityVault vault = null;
        try {
            vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {
                @Override
                public SecurityVault run() throws Exception {
                    if (fqn == null || fqn.isEmpty()) {
                        return SecurityVaultFactory.get();
                    } else {
                        return SecurityVaultFactory.get(fqn);
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            Throwable t = e.getCause();
            if (t instanceof SecurityVaultException) {
                throw (SecurityVaultException)t;
            }
            if (t instanceof RuntimeException) {
                throw (RuntimeException)t;
            }
            throw new RuntimeException(t);
        }
        vault.init(vaultOptions);
        this.vault = vault;
    }
View Full Code Here

    public RuntimeVaultReader() {
    }

    protected void createVault(final String fqn, final Map<String, Object> options) throws VaultReaderException {
        Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
        SecurityVault vault = null;
        try {
            vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {
                @Override
                public SecurityVault run() throws Exception {
                    if (fqn == null || fqn.isEmpty()) {
                        return SecurityVaultFactory.get();
                    } else {
                        return SecurityVaultFactory.get(fqn);
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            Throwable t = e.getCause();
            if (t instanceof SecurityVaultException) {
                throw SecurityMessages.MESSAGES.vaultReaderException(t);
            }
            if (t instanceof RuntimeException) {
                throw SecurityMessages.MESSAGES.runtimeException(t);
            }
            throw SecurityMessages.MESSAGES.runtimeException(t);
        }
        try {
            vault.init(vaultOptions);
        } catch (SecurityVaultException e) {
            throw SecurityMessages.MESSAGES.vaultReaderException(e);
        }
        this.vault = vault;
    }
View Full Code Here

    public RuntimeVaultReader() {
    }

    protected void createVault(final String fqn, final Map<String, Object> options) throws VaultReaderException {
        Map<String, Object> vaultOptions = new HashMap<String, Object>(options);
        SecurityVault vault = null;
        try {
            vault = AccessController.doPrivileged(new PrivilegedExceptionAction<SecurityVault>() {
                @Override
                public SecurityVault run() throws Exception {
                    if (fqn == null || fqn.isEmpty()) {
                        return SecurityVaultFactory.get();
                    } else {
                        return SecurityVaultFactory.get(fqn);
                    }
                }
            });
        } catch (PrivilegedActionException e) {
            Throwable t = e.getCause();
            if (t instanceof SecurityVaultException) {
                throw new VaultReaderException(t);
            }
            if (t instanceof RuntimeException) {
                throw (RuntimeException)t;
            }
            throw new RuntimeException(t);
        }
        try {
            vault.init(vaultOptions);
        } catch (SecurityVaultException e) {
            throw new VaultReaderException(e);
        }
        this.vault = vault;
    }
View Full Code Here

TOP

Related Classes of org.jboss.security.vault.SecurityVault

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.