When a service provider receives a response control, it uses control factories to return the specific/appropriate control class implementation.
Control
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Control | Returns: A possibly null Control.A non-null control. ctl)Creates a control using this control factory. |
| public static Control | Returns: A control object created usingctl; or
ctl if a control object cannot be created using
the algorithm described above.The non-null control object containing the OID and BER data. ctl, Context The possibly null context in which the control is being created.
If null, no such information is available. ctx, Hashtable<?, ?> The possibly null environment of the context. This is used
to find the value of the env)LdapContext.CONTROL_FACTORIES property.Creates a control using known control factories. |
| ControlFactory | back to summary |
|---|---|
| protected ControlFactory() Creates a new instance of a control factory. | |
| getControlInstance | back to summary |
|---|---|
| public abstract Control getControlInstance(Control ctl) throws NamingException Creates a control using this control factory. The factory is used by the service provider to return controls that it reads from the LDAP protocol as specialized control classes. Without this mechanism, the provider would be returning controls that only contained data in BER encoded format.
Typically, For example, a factory might use the BER encoded data in basic control and return an instance of a VirtualListReplyControl.
If this factory cannot create a control using the argument supplied,
it should return null.
A factory should only throw an exception if it is sure that
it is the only intended factory and that no other control factories
should be tried. This might happen, for example, if the BER data
in the control does not match what is expected of a control with
the given OID. Since this method throws
| |
| getControlInstance | back to summary |
|---|---|
| public static Control getControlInstance(Control ctl, Context ctx, Hashtable<?, ?> env) throws NamingException Creates a control using known control factories. The following rule is used to create the control:
Note that a control factory must be public and must have a public
constructor that accepts no arguments.
In cases where the factory is in a named module then it must be in a
package which is exported by that module to the
| |