Package org.jivesoftware.smackx.commands
Interface LocalCommandFactory
-
public interface LocalCommandFactory
A factory for creating local commands. It's useful in cases where instantiation of a command is more complicated than just using the default constructor. For example, when arguments must be passed into the constructor or when using a dependency injection framework. When a LocalCommandFactory isn't used, you can provide the AdHocCommandManager a Class object instead. For more details, seeAdHocCommandManager.registerCommand(String, String, LocalCommandFactory)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalCommand
getInstance()
Returns an instance of a LocalCommand.
-
-
-
Method Detail
-
getInstance
LocalCommand getInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.SecurityException
Returns an instance of a LocalCommand.- Returns:
- a LocalCommand instance.
- Throws:
java.lang.InstantiationException
- if creating an instance failed.java.lang.IllegalAccessException
- if creating an instance is not allowed.java.lang.SecurityException
- if there was a security violation.java.lang.NoSuchMethodException
- if no such method is declaredjava.lang.reflect.InvocationTargetException
- if a reflection-based method or constructor invocation threw.java.lang.IllegalArgumentException
- if an illegal argument was given.
-
-