本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}