當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。