I believe I am past the compilation errors but I am unable to have the
customer handler actually be functional.
Here is the Handler Factory Class I created:
public class OauthHandlersFactory
extendsorg.apache.wink.server.handlers.HandlersFactory {
final private static Logger logger =
LoggerFactory.getLogger(DeploymentConfiguration.class);
public OauthHandlersFactory() {
/* This constructor must exist because it is the only one called.*/
}
public List<? extends RequestHandler> getRequestHandlers() {
logger.debug("Oauth Handler Factory Loaded");
return Arrays.asList(new OauthRequestHandler());
}
}
Then I have the OauthRequestHandler class:
public class OauthRequestHandler implements RequestHandler
which I have the handleRequest method in the class:
public void handleRequest(MessageContext context, HandlersChain chain)
Inside the RequestHandle I have tried to throwing an exception and logging
information but nothing is working.
Also, I have a wink-properties.properties file with the following line:
wink.handlersFactoryClass=se.influen.wink.handler.OauthHandlersFactory
and in my web.xml file I have added:
<init-param>
<param-name>propertiesLocation</param-name>
<param-value>wink-properties.properties</param-value>
</init-param>
Any thoughts on anything I am missing? It doesn't seem to generate any
errors.
On Wed, Mar 7, 2012 at 1:51 PM, Raymond Feng <[email protected]> wrote:
> Hi,
>
> It seems that your code has compilation errors.
>
> Thanks,
> Raymond
>
> On Mar 4, 2012, at 8:53 PM, Chris Comstock wrote:
>
>
>> I am working to try and incorporate Amber into Wink for Oauth and running
>> into an error on the custom Handler. I have created a HandlerFactory,
>> RequestHandler, and added the wink-properities.properties configuration as
>> well as modified the web.xml with the properties file location.
>>
>> The error is related to my HandlerFactory class to load the
>> RequestHandler:
>>
>> public List<? extends org.apache.wink.server.handlers.RequestHandler>
>> getRequestHandlers() {
>>
>> return Arrays.asList(se.influen.wink.handler.OauthRequestHandler);
>>
>> }
>>
>> Here is the error:
>>
>> wink/handler/OauthHandlersFactory.java:[15,44] cannot find symbol
>>
>> [ERROR] symbol : class handler
>>
>>
>> Is there something I am missing to get this custom handler to work? Or is
>> there a better way to incorporate Amber into a Wink application? At the
>> current time I am doing nothing more than attempting to get the handler to
>> generate a response.
>>
>
>
>