当前位置: 首页>>代码示例>>Java>>正文


Java RefreshFailedException类代码示例

本文整理汇总了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");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:26,代码来源:KerberosTixDateTest.java

示例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);
            }
        }
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:18,代码来源:AutoTGT.java

示例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());
        }
    }
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:KerberosTicket.java

示例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());
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:WatchesModel.java

示例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
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VariablesTreeModelFilter.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:LocalsTreeModel.java

示例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();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ObjectFieldVariable.java

示例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");
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:KerberosTicket.java

示例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;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:KerberosUtils.java

示例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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:14,代码来源:RefreshFailedExceptionTest.java

示例11: refresh

import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
@Override
public void refresh() throws RefreshFailedException {
    super.load();
}
 
开发者ID:apache,项目名称:incubator-tamaya-sandbox,代码行数:5,代码来源:URLPropertySourceFactory.java

示例12: getData

import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
@Override
protected Object[] getData() {
    return new Object[] {new RefreshFailedException("message")};
}
 
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:RefreshFailedExceptionTest.java

示例13: testCtor1

import javax.security.auth.RefreshFailedException; //导入依赖的package包/类
/**
 * @tests javax.security.auth.RefreshFailedException#RefreshFailedException()
 */
public final void testCtor1() {
    assertNull(new RefreshFailedException().getMessage());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:RefreshFailedExceptionTest.java


注:本文中的javax.security.auth.RefreshFailedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。