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


Java SocketPermission.implies方法代码示例

本文整理汇总了Java中java.net.SocketPermission.implies方法的典型用法代码示例。如果您正苦于以下问题:Java SocketPermission.implies方法的具体用法?Java SocketPermission.implies怎么用?Java SocketPermission.implies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.net.SocketPermission的用法示例。


在下文中一共展示了SocketPermission.implies方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getApplet

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Get an applet by name.
 */
@Override
public Applet getApplet(String name) {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    name = name.toLowerCase();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");
    for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = (AppletPanel)e.nextElement();
        String param = p.getParameter("name");
        if (param != null) {
            param = param.toLowerCase();
        }
        if (name.equals(param) &&
            p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");

            if (panelSp.implies(sp)) {
                return p.applet;
            }
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:AppletViewer.java

示例2: getApplets

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Return an enumeration of all the accessible
 * applets on this page.
 */
@Override
public Enumeration getApplets() {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    Vector v = new Vector();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");

    for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = (AppletPanel)e.nextElement();
        if (p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");
            if (panelSp.implies(sp)) {
                v.addElement(p.applet);
            }
        }
    }
    return v.elements();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:AppletViewer.java

示例3: getApplet

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Get an applet by name.
 */
@Override
public Applet getApplet(String name) {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    name = name.toLowerCase();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");
    for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = e.nextElement();
        String param = p.getParameter("name");
        if (param != null) {
            param = param.toLowerCase();
        }
        if (name.equals(param) &&
            p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");

            if (panelSp.implies(sp)) {
                return p.applet;
            }
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:AppletViewer.java

示例4: getApplets

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Return an enumeration of all the accessible
 * applets on this page.
 */
@Override
public Enumeration<Applet> getApplets() {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    Vector<Applet> v = new Vector<>();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");

    for (Enumeration<AppletPanel> e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = e.nextElement();
        if (p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");
            if (panelSp.implies(sp)) {
                v.addElement(p.applet);
            }
        }
    }
    return v.elements();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:AppletViewer.java

示例5: getApplets

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Return an enumeration of all the accessible
 * applets on this page.
 */
@Override
public Enumeration<Applet> getApplets() {
    Vector<Applet> v = new Vector<Applet>();
    SocketPermission panelSp =
            new SocketPermission(UrlUtils.getHostAndPort(panel.getCodeBase()), "connect");

    synchronized(appletPanels) {
        for (Enumeration<NetxPanel> e = appletPanels.elements(); e.hasMoreElements();) {
            AppletPanel p = e.nextElement();
            if (p.getDocumentBase().equals(panel.getDocumentBase())) {

                SocketPermission sp =
                    new SocketPermission(UrlUtils.getHostAndPort(p.getCodeBase()), "connect");
                if (panelSp.implies(sp)) {
                    v.addElement(p.applet);
                }
            }
        }
    }
    return v.elements();
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:26,代码来源:PluginAppletViewer.java

示例6: getApplet

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Get an applet by name.
 */
public Applet getApplet(String name) {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    name = name.toLowerCase();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");
    for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = (AppletPanel)e.nextElement();
        String param = p.getParameter("name");
        if (param != null) {
            param = param.toLowerCase();
        }
        if (name.equals(param) &&
            p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");

            if (panelSp.implies(sp)) {
                return p.applet;
            }
        }
    }
    return null;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:28,代码来源:AppletViewer.java

示例7: getApplets

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Return an enumeration of all the accessible
 * applets on this page.
 */
public Enumeration getApplets() {
    AppletSecurity security = (AppletSecurity)System.getSecurityManager();
    Vector v = new Vector();
    SocketPermission panelSp =
        new SocketPermission(panel.getCodeBase().getHost(), "connect");

    for (Enumeration e = appletPanels.elements() ; e.hasMoreElements() ;) {
        AppletPanel p = (AppletPanel)e.nextElement();
        if (p.getDocumentBase().equals(panel.getDocumentBase())) {

            SocketPermission sp =
                new SocketPermission(p.getCodeBase().getHost(), "connect");
            if (panelSp.implies(sp)) {
                v.addElement(p.applet);
            }
        }
    }
    return v.elements();
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:AppletViewer.java

示例8: main

import java.net.SocketPermission; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    SocketPermission star_All =
            new SocketPermission("*.blabla.bla", "listen,accept,connect");
    SocketPermission www_All =
            new SocketPermission("bla.blabla.bla", "listen,accept,connect");

    if (!star_All.implies(www_All)) {
        throw new RuntimeException(
               "Failed: " + star_All + " does not imply " + www_All);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:Wildcard.java

示例9: getApplet

import java.net.SocketPermission; //导入方法依赖的package包/类
/**
 * Get an applet by name.
 */
@Override
public Applet getApplet(String name) {
    name = name.toLowerCase();
    SocketPermission panelSp =
            new SocketPermission(UrlUtils.getHostAndPort(panel.getCodeBase()), "connect");
    synchronized(appletPanels) {
        for (Enumeration<NetxPanel> e = appletPanels.elements(); e.hasMoreElements();) {
            AppletPanel p = e.nextElement();
            String param = p.getParameter("name");
            if (param != null) {
                param = param.toLowerCase();
            }
            if (name.equals(param) &&
                    p.getDocumentBase().equals(panel.getDocumentBase())) {

                SocketPermission sp =
                    new SocketPermission(UrlUtils.getHostAndPort(p.getCodeBase()), "connect");

                if (panelSp.implies(sp)) {
                    return p.applet;
                }
            }
        }
    }
    return null;
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:30,代码来源:PluginAppletViewer.java


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