Added comments for proxy example.
This commit is contained in:
parent
05cb40897b
commit
1cdb59352d
@ -1,5 +1,11 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Proxy (WizardTowerProxy) controls access to the
|
||||||
|
* actual object (WizardTower).
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class App
|
public class App
|
||||||
{
|
{
|
||||||
public static void main( String[] args )
|
public static void main( String[] args )
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* The object to be proxyed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class WizardTower {
|
public class WizardTower {
|
||||||
|
|
||||||
public void enter(Wizard wizard) {
|
public void enter(Wizard wizard) {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package com.iluwatar;
|
package com.iluwatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* The proxy controlling access to WizardTower.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class WizardTowerProxy extends WizardTower {
|
public class WizardTowerProxy extends WizardTower {
|
||||||
|
|
||||||
private static final int NUM_WIZARDS_ALLOWED = 3;
|
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!");
|
System.out.println(wizard + " is not allowed to enter!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user