wood burning stoves 2.0*
The moose likes Struts and the fly likes Regarding Plugin Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding Plugin Interface" Watch "Regarding Plugin Interface" New topic
Author

Regarding Plugin Interface

abhishek paul
Greenhorn

Joined: Sep 26, 2006
Posts: 25
hi Ranchers...hope to find clarifications for the below mentioned topics...

(1)A method in an Interface cannot have a body...but in case of the Interface org.apache.struts.action.Plugin the methods destroy() and init() have bodies..Please provide an explaination for this.The class org.apache.struts.tiles.TilesPlugin which implements Plugin does however override the above mentioned methods.

(2)The class org.apache.struts.tiles.TilesRequestProcessor extends RequestProcessor but does not override the processPreprocess(HttpServletRequest p1,HttpServletResponse p2){} method.Can anyone provide the steps how the steps takes place while using Tiles framework.


SCJP5 -
To repeat what others have said, requires education, to challenge it , requires brains.
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
Originally posted by abhishek paul:

(1)A method in an Interface cannot have a body...but in case of the Interface org.apache.struts.action.Plugin the methods destroy() and init() have bodies..Please provide an explaination for this.The class org.apache.struts.tiles.TilesPlugin which implements Plugin does however override the above mentioned methods.



Where did you find the source for Plugin interface ? I just checked the source and found only method declarations.

Regards,
Reghu


Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
abhishek paul
Greenhorn

Joined: Sep 26, 2006
Posts: 25
The package content is as given below....let me know in case i have skipped something here.. !!The methods should end with semi colons and without curly braces...if not i need to revisit Kathy Sierra javascript: x()
Eek!

package org.apache.struts.action;

public interface PlugIn
{
//
// Methods
//
void destroy() { }

void init(org.apache.struts.action.ActionServlet p1, org.apache.struts.config.ModuleConfig p2) { }
}


[ April 29, 2008: Message edited by: abhishek paul ]
[ April 29, 2008: Message edited by: abhishek paul ]
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
This is the link i found from the web

Plugin source

Here, there is no method body. Could you provide the link from where you got this strange source
abhishek paul
Greenhorn

Joined: Sep 26, 2006
Posts: 25
..thanks Reghu this is exactly what i had intended it should be..while checking the "Go to Declaration" in the IDE (Jdeveloper) the Plugin Interface displayed the above code....anyways this clarifies the first point.

Please provide suggestions for the second one as well.


Thanks,
Abhishek.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding Plugin Interface
 
Similar Threads
LoginPanel is not abstract and does not override abstract method actionPerformed..
Can anonymous inner class implements mutiple interfaces?
java adapter pattern
interface
interfaces