本文整理汇总了Java中javax.security.auth.RefreshFailedException类的典型用法代码示例。如果您正苦于以下问题:Java RefreshFailedException类的具体用法?Java RefreshFailedException怎么用?Java RefreshFailedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RefreshFailedException类属于javax.security.auth包,在下文中一共展示了RefreshFailedException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDestroy
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
private static void testDestroy(KerberosTicket t) throws Exception {
t.destroy();
if (!t.isDestroyed()) {
throw new RuntimeException("ticket should have been destroyed");
}
// Although these methods are meaningless, they can be called
for (Method m: KerberosTicket.class.getDeclaredMethods()) {
if (Modifier.isPublic(m.getModifiers())
&& m.getParameterCount() == 0) {
System.out.println("Testing " + m.getName() + "...");
try {
m.invoke(t);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
if (cause instanceof RefreshFailedException ||
cause instanceof IllegalStateException) {
// this is OK
} else {
throw e;
}
}
}
}
System.out.println("Destroy Test Passed");
}
示例2: renew
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
@Override
public void renew(Map<String, String> credentials, Map topologyConf) {
KerberosTicket tgt = getTGT(credentials);
if (tgt != null) {
long refreshTime = getRefreshTime(tgt);
long now = System.currentTimeMillis();
if (now >= refreshTime) {
try {
LOG.info("Renewing TGT for " + tgt.getClient());
tgt.refresh();
saveTGT(tgt, credentials);
} catch (RefreshFailedException e) {
LOG.warn("Failed to refresh TGT", e);
}
}
}
}
示例3: refresh
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
public void refresh() throws RefreshFailedException {
checkState();
if (!flags[RENEWABLE]) {
throw new RefreshFailedException(Messages.getString("auth.44")); //$NON-NLS-1$
}
if (System.currentTimeMillis() > this.renewTill.getTime()) {
throw new RefreshFailedException(Messages.getString("auth.45")); //$NON-NLS-1$
}
try {
KrbClient.doTGS();
} catch (KerberosException e) {
throw new RefreshFailedException(e.getMessage());
}
}
示例4: refresh
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/** Does wait for the value to be evaluated. */
public void refresh() throws RefreshFailedException {
synchronized (evaluating) {
if (evaluating[0]) {
try {
evaluating.wait();
} catch (InterruptedException iex) {
throw new RefreshFailedException(iex.getLocalizedMessage());
}
}
}
}
示例5: waitToEvaluate
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
private static void waitToEvaluate(Object o) {
if (o instanceof Refreshable) {
// waits for the evaluation, the retrieval must already be initiated
try {
((Refreshable) o).refresh();
} catch (RefreshFailedException exc) {
// Thrown when interrupted
Thread.currentThread().interrupt();
}
}
loadAllTypes(o); // Initialize all types, implemented interfaces and super classes
}
示例6: isLeaf
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
public boolean isLeaf (final Object o) throws UnknownTypeException {
if (o.equals (ROOT))
return false;
if (o instanceof AbstractVariable) {
if (o instanceof FieldVariable) {
return true;
}
if (o instanceof Refreshable && !((Refreshable) o).isCurrent()) {
debugger.getRequestProcessor().post(new Runnable() {
public void run() {
try {
((Refreshable) o).refresh();
} catch (RefreshFailedException ex) {
return ;
}
if (!(((AbstractVariable) o).getInnerValue () instanceof ObjectReference)) {
fireNodeChildrenChanged(o);
}
}
});
return false;
}
return !(((AbstractVariable) o).getInnerValue () instanceof ObjectReference);
}
if (o.toString().startsWith("SubArray")) {
return false;
}
if (o.equals ("NoInfo")) // NOI18N
return true;
if (o instanceof JPDAClassType) return false;
if (o instanceof Operation) return false;
if (o == "lastOperations") return false;
if (o == NO_DEBUG_INFO) return true;
if (o instanceof String && ((String) o).startsWith("operationArguments")) { // NOI18N
return false;
}
throw new UnknownTypeException (o);
}
示例7: refresh
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/** Does wait for the value to be evaluated. */
@Override
public void refresh() throws RefreshFailedException {
if (valueSet) return ;
synchronized (valueLock) {
if (!valueRetrieved) {
getInnerValue();
}
}
}
示例8: refresh
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/**
* If the ticket is renewable, and the renewal time has not yet elapsed,
* attempt to renew the ticket.
* @throws RefreshFailedException if the renewal fails for any reason
*/
public void refresh() throws RefreshFailedException, NotImplementedException
{
if (! isRenewable())
throw new RefreshFailedException("not renewable");
if (renewTill != null
&& System.currentTimeMillis() >= renewTill.getTime())
throw new RefreshFailedException("renewal time elapsed");
// FIXME: must contact the KDC.
// Use the java.security.krb5.kdc property...
throw new RefreshFailedException("not implemented");
}
示例9: isCurrent
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
private static boolean isCurrent(KerberosTicket ticket) {
if (!ticket.isCurrent()) {
try {
ticket.refresh();
} catch (RefreshFailedException e) {
try {
ticket.destroy();
} catch (DestroyFailedException e1) {
e1.printStackTrace();
}
return false;
}
}
return true;
}
示例10: testCtor2
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/**
* @tests javax.security.auth.RefreshFailedException#RefreshFailedException(
* java.lang.String)
*/
public final void testCtor2() {
assertNull(new RefreshFailedException(null).getMessage());
String message = "";
assertSame(message, new RefreshFailedException(message).getMessage());
message = "message";
assertSame(message, new RefreshFailedException(message).getMessage());
}
示例11: refresh
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
@Override
public void refresh() throws RefreshFailedException {
super.load();
}
示例12: getData
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
@Override
protected Object[] getData() {
return new Object[] {new RefreshFailedException("message")};
}
示例13: testCtor1
import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/**
* @tests javax.security.auth.RefreshFailedException#RefreshFailedException()
*/
public final void testCtor1() {
assertNull(new RefreshFailedException().getMessage());
}