PDA

View Full Version : Throw Exceptions from Fulfillment ID Generator



mguthrie66
01-19-2010, 06:10 PM
Hi all,
We are overriding the fulfillment id generator to do some validation at the time of licensing. We chose to do it here because all the components we need are available. The problem with this is that if the validation fails there is no way (that I know of) to throw an exception that the user will see. The implemented methods do not allow throwing of anything. I have tried using PRDBaseRuntimeException and RuntimeException, but neither work. I just get an Unknown Error. Can someone help?
Thanks,
Mike Guthrie
Emulex Corporation

peter.cameron
02-07-2010, 09:29 AM
Hi Mike,

Using the id generator as a validator isn't really the premise of the API - hence the lack of declared exceptions.
However, if there's no alternative, you could consider extending the (abstract )FLEXnetBaseRuntimeException class. As this is then an unchecked exception you can throw it from your generator. FLEXnet will then propogate the exception to the front-end.

public class MyValidationException extends FLEXnetRuntimeException {
//....
}


Hope this helps.

Peter Cameron.

mguthrie66
02-17-2010, 11:26 AM
Hi Peter,
Thanks for your response. I had figured it out by placing a property/value pair in PublisherDefinedAttributesText_en.properties and using a PRDBaseRuntimeException.
Thanks,
Mike