java.rmi.AccessException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中java.rmi.AccessException.<init>()方法的一些代码示例,展示了AccessException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AccessException.<init>()方法的具体详情如下:
包路径:java.rmi.AccessException
类名称:AccessException
方法名:<init>

AccessException.<init>介绍

[英]Constructs an AccessException with the specified detail message.
[中]使用指定的详细信息消息构造AccessException

代码示例

代码示例来源:origin: aragozin/jvm-tools

public void bind(String paramString, Remote paramRemote) throws AccessException {
  throw new AccessException("Cannot modify this registry");
}

代码示例来源:origin: aragozin/jvm-tools

public void rebind(String paramString, Remote paramRemote) throws AccessException {
  throw new AccessException("Cannot modify this registry");
}

代码示例来源:origin: aragozin/jvm-tools

public void unbind(String paramString) throws AccessException {
    throw new AccessException("Cannot modify this registry");
  }
}

代码示例来源:origin: org.gridkit.jvmtool/sjk-core

public void unbind(String paramString) throws AccessException {
    throw new AccessException("Cannot modify this registry");
  }
}

代码示例来源:origin: org.gridkit.jvmtool/sjk-core

public void bind(String paramString, Remote paramRemote) throws AccessException {
  throw new AccessException("Cannot modify this registry");
}

代码示例来源:origin: org.gridkit.jvmtool/sjk-core

public void rebind(String paramString, Remote paramRemote) throws AccessException {
  throw new AccessException("Cannot modify this registry");
}

代码示例来源:origin: org.ow2.jonas/jonas-security-core

/**
 * Create a AccessException with the given message and set the cause to the
 * given Exception
 * @param msg Exception message
 * @param t Root cause
 * @return AccessException the chained exception
 */
private static AccessException createChainedAccessException(String msg, Throwable t) {
  if (t instanceof Exception) {
    // If this is an Exception subclass, we can directly chain the cause.
    return new AccessException(msg, (Exception) t);
  } else {
    // In the other case, no chaining is possible
    // We simply put the cause's message in brackets and append
    // it to the new AccessException
    String causeMessage = "[inner cause message: " + t.getMessage() + "]";
    return new AccessException(msg + causeMessage);
  }
}

代码示例来源:origin: org.objectweb.jonas/jonas-security

/**
 * Create a AccessException with the given message and set the cause to the
 * given Exception
 * @param msg Exception message
 * @param t Root cause
 * @return AccessException the chained exception
 */
private static AccessException createChainedAccessException(String msg, Throwable t) {
  if (t instanceof Exception) {
    // If this is an Exception subclass, we can directly chain the cause.
    return new AccessException(msg, (Exception) t);
  } else {
    // In the other case, no chaining is possible
    // We simply put the cause's message in brackets and append
    // it to the new AccessException
    String causeMessage = "[inner cause message: " + t.getMessage() + "]";
    return new AccessException(msg + causeMessage);
  }
}

代码示例来源:origin: stackoverflow.com

public CLogin loadLogin(String userName) throws AccessException {
   try {
     Session sesion = this._dao.init();
     CLogin login = (CLogin) sesion.createCriteria(CLogin.class).add(
         Restrictions.ilike("_Login", userName.toLowerCase(), MatchMode.EXACT))
         .uniqueResult();
     if (login == null) {
       throw new AccessException("User does not exist");
     }
     return login;
   } catch (HibernateException e) {
     throw new AccessException(e.getMessage(), e);
   }
 }

代码示例来源:origin: org.ow2.jonas/jonas-security-core

/**
 * Authenticate a given user
 * @param principalName name of the user
 * @param arrayPass password of the user
 * @param entryName the name of the JAAS entry to search in jaas configuration file
 * @throws RemoteException if the authentication failed
 * @return an authenticated subject if it succeed
 */
public Subject authenticateJAAS(String principalName, char[] arrayPass, String entryName) throws RemoteException {
  // entry arg ?
  if (entryName == null) {
    throw new AccessException("The 'entryName' parameter is required and cannot be null.");
  }
  // Create a Login context
  LoginContext loginContext = null;
  try {
    loginContext = new LoginContext(entryName, new NoInputCallbackHandler(principalName, new String(arrayPass)));
  } catch (LoginException e) {
    throw new AccessException("Login Exception for user '" + principalName + "' : " + e.getMessage());
  }
  // Negotiate a login via this LoginContext
  try {
    loginContext.login();
  } catch (LoginException e) {
    throw new AccessException("Login Exception for user '" + principalName + "' : " + e.getMessage());
  }
  return loginContext.getSubject();
}

代码示例来源:origin: org.objectweb.jonas/jonas-security

/**
 * Authenticate a given user
 * @param principalName name of the user
 * @param arrayPass password of the user
 * @param entryName the name of the JAAS entry to search in jaas configuration file
 * @throws RemoteException if the authentication failed
 * @return an authenticated subject if it succeed
 */
public Subject authenticateJAAS(String principalName, char[] arrayPass, String entryName) throws RemoteException {
  // entry arg ?
  if (entryName == null) {
    throw new AccessException("The 'entryName' parameter is required and cannot be null.");
  }
  // Create a Login context
  LoginContext loginContext = null;
  try {
    loginContext = new LoginContext(entryName, new NoInputCallbackHandler(principalName, new String(arrayPass)));
  } catch (LoginException e) {
    throw new AccessException("Login Exception for user '" + principalName + "' : " + e.getMessage());
  }
  // Negotiate a login via this LoginContext
  try {
    loginContext.login();
  } catch (LoginException e) {
    throw new AccessException("Login Exception for user '" + principalName + "' : " + e.getMessage());
  }
  return loginContext.getSubject();
}

代码示例来源:origin: stackoverflow.com

throw new AccessException("Problem invoking method: getDbConfig" , ex);

代码示例来源:origin: org.glassfish.ejb/ejb-container

/**
 * Check if caller is authorized to invoke the method.
 * Only called for EJBObject and EJBHome methods,
 * from EJBHome|ObjectImpl classes.
 * @param method an integer identifying the method to be checked,
 *                must be one of the EJB{Home|Object}_* constants.
 */
void authorizeRemoteMethod(int method)
  throws RemoteException
{
  EjbInvocation inv = invFactory.create();
  inv.isLocal = false;
  inv.isHome = EJB_INTF_METHODS_INFO[method];
  inv.method = ejbIntfMethods[method];
  inv.invocationInfo = ejbIntfMethodInfo[method];
  if ( !authorize(inv) ) {
    AccessException ex = new AccessException(
      "Client is not authorized for this invocation.");
    // TODO see note above about additional special exception handling needed
    Throwable t = mapRemoteException(inv);
    if ( t instanceof RuntimeException )
      throw (RuntimeException)t;
    else if ( t instanceof RemoteException )
      throw (RemoteException)t;
    else
      throw ex; // throw the AccessException
  }
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-client

return new AccessException(e.getMessage(), (Exception) e.getCause());
} else {
  return new AccessException(e.getMessage());

代码示例来源:origin: org.apache.openejb/openejb-client

return new AccessException(e.getMessage(), (Exception) e.getCause());
} else {
  return new AccessException(e.getMessage());

代码示例来源:origin: org.ow2.jonas/jonas-security-core

throw new AccessException("The 'resourceName' parameter is required and cannot be null.");
throw new AccessException("The resource '" + resourceName + "' is not available.");
throw new AccessException("User '" + principalName + "' not found.");
throw new AccessException("The password for the user '" + principalName + "' is not valid");

代码示例来源:origin: org.glassfish.main.ejb/ejb-container

/**
 * Check if caller is authorized to invoke the method.
 * Only called for EJBObject and EJBHome methods,
 * from EJBHome|ObjectImpl classes.
 * @param method an integer identifying the method to be checked,
 *                must be one of the EJB{Home|Object}_* constants.
 */
protected void authorizeRemoteMethod(int method)
  throws RemoteException
{
  EjbInvocation inv = invFactory.create();
  inv.isLocal = false;
  inv.isHome = EJB_INTF_METHODS_INFO[method];
  inv.method = ejbIntfMethods[method];
  inv.invocationInfo = ejbIntfMethodInfo[method];
  if ( !authorize(inv) ) {
    // TODO see note above about additional special exception handling needed
    Throwable t = mapRemoteException(inv);
    if ( t instanceof RuntimeException )
      throw (RuntimeException)t;
    else if ( t instanceof RemoteException )
      throw (RemoteException)t;
    else
      throw new AccessException(localStrings.getLocalString(
        "ejb.client_not_authorized",
        "Client not authorized for this invocation")); // throw the AccessException
  }
}

代码示例来源:origin: org.objectweb.jonas/jonas-security

throw new AccessException("The 'resourceName' parameter is required and cannot be null.");
throw new AccessException("The resource '" + resourceName + "' is not available.");
throw new AccessException("User '" + principalName + "' not found.");
throw new AccessException("The password for the user '" + principalName + "' is not valid");

代码示例来源:origin: hm.binkley/binkley-util

/** Check that constructs compiles. */
  private static void compile()
      throws InterruptedException, AccessException {
    checked(Stream.of(1)).
        parallel(null).
        map(i -> {
          throw new NullPointerException();
        }).
        map(i -> {
          throw new AccessException("foo");
        }).
        count();

    checked(Stream.of(1)).
        distinct().
        filter(isEqual(1)).
        flatMap(i -> range(i, i).boxed()).
        limit(1).
        map(identity()).
        onClose(() -> {
        }).
        peek(i -> {
        }).
        skip(0).
        sorted().
        unordered().
        toArray();
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

throw new AccessLocalException(exc.getMessage()).initCause(exc.getCause());
} else {
  throw new AccessException(exc.getMessage());

相关文章

微信公众号

最新文章

更多