com.philemonworks.selfdiagnose.check
Class CheckJNDIBinding

java.lang.Object
  extended by com.philemonworks.selfdiagnose.DiagnosticTask
      extended by com.philemonworks.selfdiagnose.check.CheckJNDIBinding
All Implemented Interfaces:
Serializable

public class CheckJNDIBinding
extends DiagnosticTask

CheckJNDIBinding is a task to check whether the naming server has a JNDI binding for a given name.

 <checkjndibinding name="jdbc/mydb"/>
 <checkjndibinding name="jdbc/mydb" class="mypackage.DataSource"/>
 <checkjndibinding name="jdbc/mydb" class="mypackage.DataSource" url="localhost:900" factory="someFactory"/>
 
Stores the value found into the (optional) specified variable.

Author:
E.M.Micklei
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.philemonworks.selfdiagnose.DiagnosticTask
comment, PARAMETER_COMMENT, PARAMETER_REPORT, PARAMETER_VARIABLE, reportResults, requestor, variableName
 
Constructor Summary
CheckJNDIBinding()
           
 
Method Summary
 String getDescription()
          Return the description of this task.
 String getInitalContextFactory()
           
 String getJndiName()
           
 String getNamingServerURL()
           
 String getValueClassName()
           
 boolean hasContextFactorySpecified()
           
 boolean hasValueClassSpecified()
           
 void initializeFromAttributes(Attributes attributes)
          This method is sent from the SelfDiagnoseHandler when a configuration is being processed.
 void run(ExecutionContext ctx, DiagnosticTaskResult result)
          Run the task.
 void setInitalContextFactory(String string)
           
 void setJndiName(String string)
           
 void setNamingServerURL(String string)
           
 void setUp(ExecutionContext ctx)
          Override this method to verify that task parameters are initialized/set correctly.
 void setValueClassName(String class1)
           
 
Methods inherited from class com.philemonworks.selfdiagnose.DiagnosticTask
createResult, getComment, getDefaultReportTemplate, getRequestor, getTaskName, getVariableName, hasComment, isReportResults, run, run, setComment, setReportResults, setRequestor, setVariableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckJNDIBinding

public CheckJNDIBinding()
Method Detail

getDescription

public String getDescription()
Return the description of this task.

Specified by:
getDescription in class DiagnosticTask
Returns:
String the description

initializeFromAttributes

public void initializeFromAttributes(Attributes attributes)
Description copied from class: DiagnosticTask
This method is sent from the SelfDiagnoseHandler when a configuration is being processed. Use the passed attributes to initialize the receiver. If a variable parameter is passed then store it.

Overrides:
initializeFromAttributes in class DiagnosticTask
Parameters:
attributes - org.xml.sax.Attributes

setUp

public void setUp(ExecutionContext ctx)
           throws DiagnoseException
Description copied from class: DiagnosticTask
Override this method to verify that task parameters are initialized/set correctly.

Overrides:
setUp in class DiagnosticTask
Parameters:
ctx - ExecutionContext
Throws:
DiagnoseException

hasContextFactorySpecified

public boolean hasContextFactorySpecified()

hasValueClassSpecified

public boolean hasValueClassSpecified()

run

public void run(ExecutionContext ctx,
                DiagnosticTaskResult result)
         throws DiagnoseException
Description copied from class: DiagnosticTask
Run the task. If an error is detected then raise a DiagnoseException. Otherwise use the result object to the report any messages when a run is completed.

Specified by:
run in class DiagnosticTask
Parameters:
ctx - ExecutionContext
result - DiagnosticTaskResult
Throws:
DiagnoseException

getInitalContextFactory

public String getInitalContextFactory()
Returns:
String initalContextFactory

getNamingServerURL

public String getNamingServerURL()
Returns:
String namingServerURL

getValueClassName

public String getValueClassName()
Returns:
String

setInitalContextFactory

public void setInitalContextFactory(String string)
Parameters:
string -

setNamingServerURL

public void setNamingServerURL(String string)
Parameters:
string -

setValueClassName

public void setValueClassName(String class1)
Parameters:
class1 -

getJndiName

public String getJndiName()
Returns:
String jndiName

setJndiName

public void setJndiName(String string)
Parameters:
string -


Copyright © 2012. All Rights Reserved.