java.lang.SecurityException.initCause()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(112)

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

SecurityException.initCause介绍

暂无

代码示例

代码示例来源:origin: kaaproject/kaa

SecurityException securityException =
   new SecurityException(formatIllegalAccessErrorMessage(target, serviceMethod));
 securityException.initCause(ex);
 throw securityException;
} catch (IllegalArgumentException ex) {
 SecurityException securityException =
   new SecurityException(formatIllegalArgumentErrorMessage(target, serviceMethod, args));
 securityException.initCause(ex);
 throw securityException;
} catch (InvocationTargetException ex) {

代码示例来源:origin: wildfly/wildfly

statusRef.set(oldVal);
  final SecurityException e = Log.log.peerSecurityException();
  e.initCause(RemoteExceptionCause.readFromStream(is));
  throw e;
} else {

代码示例来源:origin: wildfly/wildfly

statusRef.set(oldVal);
  final SecurityException e = Log.log.peerSecurityException();
  e.initCause(RemoteExceptionCause.readFromStream(is));
  throw e;
} else {

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: wildfly/wildfly

int len = StreamUtils.readPackedSignedInt32(is);
final SecurityException sx = Log.log.peerSecurityException();
sx.initCause(RemoteExceptionCause.readFromStream(is));
if ((id = is.read()) != -1) {
  XAException ex = Log.log.unrecognizedParameter(XAException.XAER_RMFAIL, id);

代码示例来源:origin: com.google.gwt/gwt-servlet

public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
  SerializationPolicy serializationPolicy, int flags) throws SerializationException {
 if (serviceMethod == null) {
  throw new NullPointerException("serviceMethod");
 }
 if (serializationPolicy == null) {
  throw new NullPointerException("serializationPolicy");
 }
 String responsePayload;
 try {
  Object result = serviceMethod.invoke(target, args);
  responsePayload = encodeResponseForSuccess(serviceMethod, result, serializationPolicy, flags);
 } catch (IllegalAccessException e) {
  SecurityException securityException =
    new SecurityException(formatIllegalAccessErrorMessage(target, serviceMethod));
  securityException.initCause(e);
  throw securityException;
 } catch (IllegalArgumentException e) {
  SecurityException securityException =
    new SecurityException(formatIllegalArgumentErrorMessage(target, serviceMethod, args));
  securityException.initCause(e);
  throw securityException;
 } catch (InvocationTargetException e) {
  // Try to encode the caught exception
  //
  Throwable cause = e.getCause();
  responsePayload = encodeResponseForFailure(serviceMethod, cause, serializationPolicy, flags);
 }
 return responsePayload;
}

代码示例来源:origin: sk.seges.acris/acris-server-components

/**
 * Handles an exception which is raised when a method invocation with bad
 * arguments is attempted. This implementation throws a
 * {@link SecurityException}. For details on arguments please consult
 * {@link #invokeMethodOnService(Object, Method, Object[], RPCRequest)}.
 * 
 * @param e
 *            Exception thrown
 * @param service
 * @param targetMethod
 * @return RPC encoded response (such as an RPC client exception)
 */
protected String handleIllegalArgumentException(IllegalArgumentException e, Object service, Method targetMethod,
        RPCRequest rpcRequest) {
    SecurityException securityException = new SecurityException("Blocked attempt to invoke method " + targetMethod);
    securityException.initCause(e);
    throw securityException;
}

代码示例来源:origin: net.sf.gwt-widget/gwt-sl

/**
 * Handles an exception which is raised when a method invocation with bad
 * arguments is attempted. This implementation throws a
 * {@link SecurityException}. For details on arguments please consult
 * {@link #invokeMethodOnService(Object, Method, Object[], RPCRequest)}.
 * 
 * @param e
 *            Exception thrown
 * @param service
 * @param targetMethod
 * @return RPC encoded response (such as an RPC client exception)
 */
protected String handleIllegalArgumentException(IllegalArgumentException e, Object service, Method targetMethod,
    RPCRequest rpcRequest) {
  SecurityException securityException = new SecurityException("Blocked attempt to invoke method " + targetMethod);
  securityException.initCause(e);
  throw securityException;
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-util

/**
 * generate an X509 certificate, based on the current issuer and subject
 * using the default provider "BC".
 */
public X509Certificate generateX509Certificate(
  PrivateKey      key)
  throws SecurityException, SignatureException, InvalidKeyException
{
  try
  {
    return generateX509Certificate(key, null, null);
  }
  catch (NoSuchProviderException e)
  {
    throw (SecurityException)new SecurityException("JCE provider not installed!").initCause(e);
  }
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-crypto

/**
 * generate an X509 certificate, based on the current issuer and subject
 * using the default provider and the passed in source of randomness
 */
public X509Certificate generateX509Certificate(
  PrivateKey      key,
  SecureRandom    random)
  throws SecurityException, SignatureException, InvalidKeyException
{
  try
  {
    return generateX509Certificate(key, null, random);
  }
  catch (NoSuchProviderException e)
  {
    throw (SecurityException)new SecurityException("JCE provider not installed!").initCause(e);
  }
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-crypto

/**
 * generate an X509 certificate, based on the current issuer and subject
 * using the default provider "BC".
 */
public X509Certificate generateX509Certificate(
  PrivateKey      key)
  throws SecurityException, SignatureException, InvalidKeyException
{
  try
  {
    return generateX509Certificate(key, null, null);
  }
  catch (NoSuchProviderException e)
  {
    throw (SecurityException)new SecurityException("JCE provider not installed!").initCause(e);
  }
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-util

/**
 * generate an X509 certificate, based on the current issuer and subject
 * using the default provider and the passed in source of randomness
 */
public X509Certificate generateX509Certificate(
  PrivateKey      key,
  SecureRandom    random)
  throws SecurityException, SignatureException, InvalidKeyException
{
  try
  {
    return generateX509Certificate(key, null, random);
  }
  catch (NoSuchProviderException e)
  {
    throw (SecurityException)new SecurityException("JCE provider not installed!").initCause(e);
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.osgi

public void checkContent() throws CertificateException, CertificateExpiredException {
  SignedContentEntry[] entries = signedContent.getSignedEntries();
  for (int i = 0; i < entries.length; i++) {
    try {
      entries[i].verify();
    } catch (InvalidContentException e) {
      throw (SecurityException) new SecurityException(e.getMessage()).initCause(e);
    } catch (IOException e) {
      throw (SecurityException) new SecurityException(e.getMessage()).initCause(e);
    }
  }
  SignerInfo[] infos = signedContent.getSignerInfos();
  for (int i = 0; i < infos.length; i++)
    signedContent.checkValidity(infos[i]);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi

public void checkContent() throws CertificateException, CertificateExpiredException {
  SignedContentEntry[] entries = signedContent.getSignedEntries();
  for (int i = 0; i < entries.length; i++) {
    try {
      entries[i].verify();
    } catch (InvalidContentException e) {
      throw (SecurityException) new SecurityException(e.getMessage()).initCause(e);
    } catch (IOException e) {
      throw (SecurityException) new SecurityException(e.getMessage()).initCause(e);
    }
  }
  SignerInfo[] infos = signedContent.getSignerInfos();
  for (int i = 0; i < infos.length; i++)
    signedContent.checkValidity(infos[i]);
}

代码示例来源:origin: apache/activemq-artemis

private void handleSaslStep() throws SecurityException {
 try {
   if (sasl.pending() != 0) {
    byte[] challenge = new byte[sasl.pending()];
    sasl.recv(challenge, 0, challenge.length);
    byte[] response = mechanism.getChallengeResponse(challenge);
    sasl.send(response, 0, response.length);
   }
 } catch (SaslException se) {
   // TODO - Better error message.
   SecurityException jmsse = new SecurityException("Exception while processing SASL step.");
   jmsse.initCause(se);
   throw jmsse;
 }
}

相关文章