本文整理匯總了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;
}