Added comments for proxy example.

This commit is contained in:
Ilkka Seppala 2014-08-31 10:23:14 +03:00
parent 05cb40897b
commit 1cdb59352d
3 changed files with 16 additions and 1 deletions

View File

@ -1,5 +1,11 @@
package com.iluwatar;
/**
*
* Proxy (WizardTowerProxy) controls access to the
* actual object (WizardTower).
*
*/
public class App
{
public static void main( String[] args )

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* The object to be proxyed.
*
*/
public class WizardTower {
public void enter(Wizard wizard) {

View File

@ -1,5 +1,10 @@
package com.iluwatar;
/**
*
* The proxy controlling access to WizardTower.
*
*/
public class WizardTowerProxy extends WizardTower {
private static final int NUM_WIZARDS_ALLOWED = 3;
@ -15,5 +20,4 @@ public class WizardTowerProxy extends WizardTower {
System.out.println(wizard + " is not allowed to enter!");
}
}
}