* Initializes this resource's state (properties, etc.).
*/
public void init()
{
super.init();
ResourceProperty resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_REFERENCE);
PrinterReferenceDocument printerRefDoc = PrinterReferenceDocument.Factory.newInstance();
printerRefDoc.setPrinterReference(getEpr());
resourceProperty.add(printerRefDoc);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_STATE);
PrinterStateDocument printerState = PrinterStateDocument.Factory.newInstance();
printerState.setPrinterState(PrinterStateType.IDLE);
resourceProperty.add(printerState);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_NAME);
PrinterNameDocument printName = PrinterNameDocument.Factory.newInstance();
printName.setPrinterName(m_name);
resourceProperty.add(printName);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_IS_ACCEPTING_JOBS);
PrinterIsAcceptingJobsDocument isAccepting = PrinterIsAcceptingJobsDocument.Factory.newInstance();
isAccepting.setPrinterIsAcceptingJobs(false);
resourceProperty.add(isAccepting);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.QUEUED_JOB_COUNT);
QueuedJobCountDocument queuedJobCountDocument = QueuedJobCountDocument.Factory.newInstance();
queuedJobCountDocument.setQueuedJobCount(BigInteger.valueOf(0));
resourceProperty.add(queuedJobCountDocument);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.OPERATIONS_SUPPORTED);
OperationsSupportedDocument operationsSupportedDocument =
OperationsSupportedDocument.Factory.newInstance();
List operationsSupported = new ArrayList();
operationsSupported.add(Operations.PRINT_JOB); //refer to doc...
operationsSupported.add(Operations.CREATE_JOB); //refer to doc...
operationsSupported.add(Operations.SEND_DOCUMENT); //refer to doc...
operationsSupportedDocument.setOperationsSupported(operationsSupported);
resourceProperty.add(operationsSupportedDocument);
resourceProperty = m_propSet.get(PrinterPortPropertyQNames.DOCUMENT_FORMAT_SUPPORTED);
DocumentFormatSupportedDocument documentFormatSupportedDocument =
DocumentFormatSupportedDocument.Factory.newInstance();
MimeMediaTypes mimeMediaTypes =
documentFormatSupportedDocument.addNewDocumentFormatSupported();
mimeMediaTypes.addMimeMediaType(MimeMediaTypeType.TEXT_PLAIN);
resourceProperty.add(documentFormatSupportedDocument);
}