service.html

来自「JAVA CARD 开发包规格说明,版本为2.2.2」· HTML 代码 · 共 313 行

HTML
313
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_02) on Wed Mar 22 19:19:08 PST 2006 --><TITLE>Service (Java Card API and Subsets)</TITLE><META NAME="keywords" CONTENT="javacard.framework.service.Service interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Service (Java Card API and Subsets)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Service.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javacard/framework/service/SecurityService.html" title="interface in javacard.framework.service"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javacard/framework/service/Service.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Service.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javacard.framework.service</FONT><BR>Interface Service</H2><DL><DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../javacard/framework/service/RemoteService.html" title="interface in javacard.framework.service">RemoteService</A>, <A HREF="../../../javacard/framework/service/SecurityService.html" title="interface in javacard.framework.service">SecurityService</A></DD></DL><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javacard/framework/service/BasicService.html" title="class in javacard.framework.service">BasicService</A>, <A HREF="../../../javacard/framework/service/RMIService.html" title="class in javacard.framework.service">RMIService</A></DD></DL><HR><DL><DT><PRE>public interface <B>Service</B></DL></PRE><P>This is the base interface for the service framework on the Java Card platform. A <CODE>Service</CODE> is an object that is able to perform partial or complete processing on a set of incoming commands encapsulated in an APDU. <p> Services collaborate in pre-processing, command processing and post-processing of incoming <CODE>APDU</CODE> commands. They share the same <CODE>APDU</CODE> object by using the communication framework and the Common Service Format (CSF) defined in <code>BasicService</code>. An application is built by combining pre-built and newly defined Services within a <code>Dispatcher</code> object.<P><P><DL><DT><B>Version:</B></DT>  <DD>1.0</DD><DT><B>See Also:</B><DD><A HREF="../../../javacard/framework/service/BasicService.html" title="class in javacard.framework.service"><CODE>BasicService</CODE></A></DL><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/Service.html#processCommand(javacard.framework.APDU)">processCommand</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Processes the command in the <CODE>APDU</CODE> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/Service.html#processDataIn(javacard.framework.APDU)">processDataIn</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pre-processes the input data for the command in the <CODE>APDU</CODE> object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacard/framework/service/Service.html#processDataOut(javacard.framework.APDU)">processDataOut</A></B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Post-processes the output data for the command in the <CODE>APDU</CODE> object.</TD></TR></TABLE>&nbsp;<P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="processDataIn(javacard.framework.APDU)"><!-- --></A><H3>processDataIn</H3><PRE>boolean <B>processDataIn</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>Pre-processes the input data for the command in the <CODE>APDU</CODE> object. When invoked, the APDU object should either be in <CODE>STATE_INITIAL</CODE> with the APDU buffer in the Init format or in <CODE>STATE_FULL_INCOMING</CODE> with the APDU buffer in the Input Ready format defined in <CODE>BasicService</CODE>. <p>The method must return <CODE>true</CODE> if no more pre-processing should be performed, and <CODE>false</CODE> otherwise. In particular, it must return <CODE>false</CODE> if it has not performed any processing on the command. <P> After normal completion, the <CODE>APDU</CODE> object is usually in <CODE>STATE_FULL_INCOMING</CODE> with the APDU buffer in the Input Ready format defined in <CODE>BasicService</CODE>. However, in some cases if the Service processes the command entirely, the <CODE>APDU</CODE> object may be in <CODE>STATE_OUTGOING</CODE> with the APDU buffer in the Output Ready format defined in <CODE>BasicService</CODE>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>true</code> if input processing is finished, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="processCommand(javacard.framework.APDU)"><!-- --></A><H3>processCommand</H3><PRE>boolean <B>processCommand</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>Processes the command in the <CODE>APDU</CODE> object. When invoked, the <CODE>APDU</CODE> object should normally be in <CODE>STATE_INITIAL</CODE> with the APDU buffer in the Init format or in <CODE>STATE_FULL_INCOMING</CODE> with the <CODE>APDU</CODE> buffer in the Input Ready format defined in <CODE>BasicService</CODE>. However, in some cases, if a pre-processing service has processed the command entirely, the <CODE>APDU</CODE> object may be in <CODE>STATE_OUTGOING</CODE> with the APDU buffer in the Output Ready format defined in <CODE>BasicService</CODE>. <p>The method must return <CODE>true</CODE> if no more command processing is required, and <CODE>false</CODE> otherwise. In particular, it should return <CODE>false</CODE> if it has not performed any processing on the command. <P> After normal completion, the <CODE>APDU</CODE> object must be in <CODE>STATE_OUTGOING</CODE> and the output response must be in the APDU buffer in the Output Ready format defined in <CODE>BasicService</CODE>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>true</code> if the command has been processed, <CODE>false</CODE> otherwise</DL></DD></DL><HR><A NAME="processDataOut(javacard.framework.APDU)"><!-- --></A><H3>processDataOut</H3><PRE>boolean <B>processDataOut</B>(<A HREF="../../../javacard/framework/APDU.html" title="class in javacard.framework">APDU</A>&nbsp;apdu)</PRE><DL><DD>Post-processes the output data for the command in the <CODE>APDU</CODE> object. When invoked, the <CODE>APDU</CODE> object should be in <CODE>STATE_OUTGOING</CODE> with the APDU buffer in the Output Ready format defined in <CODE>BasicService</CODE>. <p>The method should return <CODE>true</CODE> if no more post-processing is required, and <CODE>false</CODE> otherwise. In particular, it should return <CODE>false</CODE> if it has not performed any processing on the command. <P> After normal completion, the <CODE>APDU</CODE> object should must be in <CODE>STATE_OUTGOING</CODE> and the output response must be in the APDU buffer in the Output Ready format defined in <CODE>BasicService</CODE>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>apdu</CODE> - the <CODE>APDU</CODE> object containing the command being processed<DT><B>Returns:</B><DD><code>true</code> if output processing is finished, <CODE>false</CODE> otherwise</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Service.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javacard/framework/service/SecurityService.html" title="interface in javacard.framework.service"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javacard/framework/service/ServiceException.html" title="class in javacard.framework.service"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html?javacard/framework/service/Service.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Service.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright &#169; 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,<br>Santa Clara, CA, 95054, U.S.A.  All Rights Reserved.</i></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?