📄 upnpaction.java
字号:
package no.auc.one.portableplayer.communication.upnphosting;
/**
* Action for a UPnP Service.
*
* Name of the action is the same as the object instance. E.g. for this code:
* UPnPAction myAction; the name of the action becomes myAction. For standard
* actions defined by a UPnP Forum working committee, must not begin with X_
* nor A_.
*
* For non-standard actions specified by a UPnP vendor and added to a standard
* service, must begin with X_. Should be < 32 characters.
*
* Unfortunately there are no 'function reference' concept available in J2ME,
* which makes this design a bit harder then it should be to use (see Invoke
* method).
*
* XXX SHOULD change argumentList. The action should instead be required to
* return a NEW array/hashtable of arguments to be used. It must be new
* because it will be used by the framework for handling the request/
* response. Therefore it should also be disposed(GC) when the action
* invocation is finished.
*/
public abstract class UPnPAction {
private String name;
private UPnPActionArgument[] argumentList;
public UPnPAction(String name, UPnPActionArgument[] argumentList) {
this.name = name;
this.argumentList = argumentList;
}
/**
* Returns the name of this action.
*/
public String getName() {
return name;
}
/**
* List of arguments for this action.
*
* Required if and only if parameters are defined for action. (Each action
* may have >= 0 parameters.). If no parameters are defined then this
* method must return null.
*
* Any in arguments must be listed before any out arguments.
*
* Retval argument must be the first out argument.
*/
public UPnPActionArgument[] getArgumentList() {
return argumentList;
}
/**
* Invokes this action.
*
* @param args Arguments for this action, complying to the format laid out
* in the argument list of this class.
* @throws UPnPActionInvocationException If an error occurs the method
* should throw a subclass of UPnPActionInvocationException. These
* will be transformed into the correct SOAP Fault and returned
* to the callee.
*/
public abstract void invoke(UPnPActionArgument[] args)
throws UPnPActionInvocationException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -