├── .gitignore
├── LICENSE
├── src
└── main
│ ├── java
│ └── me
│ │ └── sumithpuri
│ │ └── github
│ │ └── arunachal
│ │ ├── spring
│ │ └── dynamic
│ │ │ └── sample
│ │ │ ├── Account.java
│ │ │ └── AccountingBean.java
│ │ └── app
│ │ └── Arunachal.java
│ └── resources
│ ├── accounting.xml
│ └── DynamicAccount.rb
├── pom.xml
├── README.md
└── DynamicAccount.rb
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Sumith Kumar Puri
4 |
5 | [Refer Each Code File for the Actual Licence Statement]
6 |
--------------------------------------------------------------------------------
/src/main/java/me/sumithpuri/github/arunachal/spring/dynamic/sample/Account.java:
--------------------------------------------------------------------------------
1 | package me.sumithpuri.github.arunachal.spring.dynamic.sample;
2 |
3 | import org.springframework.beans.factory.DisposableBean;
4 |
5 | public interface Account {
6 |
7 | public int getAccountId();
8 |
9 | public long getAccountAmt();
10 |
11 | public String getAccountName();
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/accounting.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | 4.0.0
5 |
6 | me.sumithpuri.github
7 | skp-mini-marathon-arunachal
8 | 0.0.1-SNAPSHOT
9 | jar
10 |
11 | skp-mini-marathon-arunachal
12 | http://maven.apache.org
13 |
14 |
15 | UTF-8
16 | 9
17 | 9
18 | false
19 |
20 |
21 |
22 |
23 | junit
24 | junit
25 | 3.8.1
26 | test
27 |
28 |
29 |
30 | org.springframework
31 | spring
32 | 2.5.5
33 |
34 |
35 | org.jruby
36 | jruby-complete
37 | 1.0.3
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | org.apache.maven.plugins
46 | maven-compiler-plugin
47 | 3.6.1
48 |
49 |
50 |
51 | org.codehaus.mojo
52 | exec-maven-plugin
53 | 1.6.0
54 |
55 |
56 | test
57 |
58 | java
59 |
60 |
61 | me.sumithpuri.github.arunachal.app.Arunachal
62 | true
63 |
64 |
65 |
66 |
67 |
68 |
69 | Brainbench Spring 2.5 Certification (+ Spring In Action Samples)
70 |
71 |
--------------------------------------------------------------------------------
/src/main/java/me/sumithpuri/github/arunachal/spring/dynamic/sample/AccountingBean.java:
--------------------------------------------------------------------------------
1 | package me.sumithpuri.github.arunachal.spring.dynamic.sample;
2 |
3 | import org.springframework.beans.factory.DisposableBean;
4 |
5 | /**
6 | * MIT License
7 | *
8 | * Copyright (c) 2018-19, Sumith Kumar Puri
9 |
10 | * GitHub URL https://github.com/sumithpuri
11 | * Code Sample Brainbench Spring 2.5 Certification [+ Spring In Action Samples]
12 | * Sample Topic Core Spring (Dynamic Languages)
13 | * Certificate URL https://goo.gl/X321kd
14 | * Package Prefix me.sumithpuri.github.arunachal
15 | * Project Codename arunachal
16 | * Contact E-Mail code@sumithpuri.me
17 | * Contact WhatsApp +91 9591497974
18 | *
19 | *
20 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
21 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
22 | * rights to use, copy, modify, merge, publish, distribute, sub-license and/or sell copies of the Software and to permit
23 | * persons to whom the Software is furnished to do so, subject to the following conditions:
24 | *
25 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
26 | * Software.
27 | *
28 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
29 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
30 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
31 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 | */
33 | public class AccountingBean implements DisposableBean {
34 |
35 | private Account account;
36 |
37 | AccountingBean(Account account) {
38 | System.out.println("New Bean Created!");
39 | this.account = account;
40 | }
41 |
42 | public void displayAccountInformation() {
43 |
44 | System.out.println("NUMBER: " + account.getAccountId());
45 | System.out.println("NAME: " + account.getAccountName());
46 | System.out.println("AMOUNT: " + account.getAccountAmt());
47 | }
48 |
49 | @Override
50 | public void destroy() throws Exception {
51 | account = null;
52 |
53 | }
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Arunachal (Brainbench Spring 2.5 Certification)
2 | Brainbench Spring 2.5 Certification (+ Spring In Action Samples)
3 |
4 | MIT License, Copyright (c) 2018-19, Sumith Kumar Puri
5 | https://github.com/sumithpuri
6 |
7 |
8 |
14 |
15 | |Project Codename|Arunachal|
16 | |--|--|
17 | |Certification|Brainbench Spring 2.5 Certification|
18 | |Certificate URL|https://goo.gl/X321kd|
19 | |Sample Topic|Core Spring (Dynamic Languages)|
20 | |Package Prefix|me.sumithpuri.github.arunachal|
21 | |GitHub URL|https://github.com/sumithpuri/skp-mini-marathon-arunachal|
22 | |Contact E-Mail |code@sumithpuri.me|
23 | |Contact Number|+91 9591497974 (WhatsApp, Viber, Telegram)|
24 | |Historical|✅ Started this Movement of 1000s of Lines of Java/EE* Code to GitHub
✅ Was a Senior Software Architect (Java/EE) in Manila*, 2018 (At Start)
✅ Named this Initial Code Journey as [ Manila Code Marathon - 2018 ]
✅ Code Is Non-Proprietary / Non-Copyright from my Work Experience.
✅ Was Back to Bangalore, Named as [ Bangalore Code Nights - 2019. ]
✅ Added More Code under [ -20 Days of Code in Benglauru- ] in 2020
✅ Celebration of Java/Java EE Code as Java Turned 25 in the Year 2020! |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |  |
35 |
36 | ❤️ Ex-Yahoo, Symantec, Huawei, Oracle*, OpenText*, Finastra*, Atos* 🧡 Xth, XIIth (Computer Science) - Naval Public School, Kochi, India 💛 Bachelor of Engineering (Computer Science)* - SRSIT, Bangalore 💜 Executive Program ( Data Mining and Analytics ) - [IIT, Roorkee] 💚 Executive Certificate Program (Entrepreneurship) - IIM, Kashipur
💙 Proficience (Cryptography & Network Security) - IISc, Bangalore 🤎 Proficience (Innovative Product Design & Dev.) - IISc, Bangalore 🖤 Proficience (Artficial Intelligence/Intelli Agents) - IISc, Bangalore
💎 Sun Certified Java Programmer 1.4 (Core Java) 💎 Sun Certified Java Programmer 5.0 (Core Java) 💎 Sun Certified Business Component Developer 1.3 (EJB/J2EE) 💎 Sun Certified Business Component Developer 5.0 (EJB/J2EE) 💎 Brainbench Spring 2.x Certification*, ( J2EE/Spring ) 💎 Brainbench Hibernate 3.x Certification* (Hibernate) 💎 Brainbench Java EE 6.x Certification*, ( J2EE ) 💎 Quest C Lang. Certification (C Programming) 💎 Quest C++ Certification (C++ Programming) 💎 Quest Data Structures Certification ( C/C++ )
37 | 🏁 Highest IQ (147) ~ Among Entire Secondary School Batch ~ (Xth) 🏁 MVIT Inter-Collegiate C Programming Contest (Finalist, Top 8) 🏁 SJCIT Inter-Collegiate Web Design (Runners-Up) 🏁 Google India Code Jam 2005 (#376/14,000) - India + SE Asia 🏁 Microsoft Bizspark Startup 2011-'12 (Shortlisted/Recognized) 🏁 Societe Generale Brainwaves Hackathon 2015 (Corp Finalist, AI) 🏁 Mphasis Internal Hackathon Challenge, Season-07 (#07/106)* 🏁 Techgig Code Gladiators 2015 (Open, Top 500) 🏁 Accenture in India YouTube Contest 2015 (BigData, Winner) 🏁 Xebia-Microsoft-GitHub Blogathon 2022 (Microservices, Winner)
🏆 Senior Member, ACM (Elevated) and Senior Member, IEEE (Elevated) 🏆 Author/Blogger, Technology Advice (Developer.com and jGuru) 🏆 DZone Most Valuable Blogger and DZone Core (Elevated)** 🏆 Author and Blogger, Friends of Open JDK Community (Foojay.IO) 🏆 Blogger, Java Code Geeks Program (Shortlisted/Recognized) 🏆 Paid Blogger, Developer.com and jGuru; Blogger, HackerNoon; 🎯 19y Across Associate/Engineer (2003) to Java Practice Leader (2024) |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
🔴 ALL COPYRIGHTS FOR THE ABOVE PUBLICLY AVAILABLE IMAGE OR PARTS OF THE IMAGE ARE WITH THEIR RESPECTIVE OWNERS, SOURCED/USED FROM GOOGLE SEARCH
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/main/java/me/sumithpuri/github/arunachal/app/Arunachal.java:
--------------------------------------------------------------------------------
1 | package me.sumithpuri.github.arunachal.app;
2 |
3 | import java.io.BufferedWriter;
4 | import java.io.File;
5 | import java.io.FileReader;
6 | import java.io.FileWriter;
7 | import java.nio.file.Paths;
8 |
9 | import org.springframework.context.support.AbstractRefreshableApplicationContext;
10 | import org.springframework.context.support.ClassPathXmlApplicationContext;
11 |
12 | import me.sumithpuri.github.arunachal.spring.dynamic.sample.AccountingBean;
13 |
14 | /**
15 | * MIT License
16 | *
17 | * Copyright (c) 2018-19, Sumith Kumar Puri
18 |
19 | * GitHub URL https://github.com/sumithpuri
20 | * Code Sample Brainbench Spring 2.5 Certification [+ Spring In Action Samples]
21 | * Sample Topic Core Spring (Dynamic Languages)
22 | * Certificate URL https://goo.gl/X321kd
23 | * Package Prefix me.sumithpuri.github.arunachal
24 | * Project Codename arunachal
25 | * Contact E-Mail code@sumithpuri.me
26 | * Contact WhatsApp +91 9591497974
27 | *
28 | *
29 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
30 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
31 | * rights to use, copy, modify, merge, publish, distribute, sub-license and/or sell copies of the Software and to permit
32 | * persons to whom the Software is furnished to do so, subject to the following conditions:
33 | *
34 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
35 | * Software.
36 | *
37 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
38 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
39 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
40 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41 | */
42 | public class Arunachal {
43 |
44 | AccountingBean accountingBean;
45 | static boolean update = false;
46 | private static String scriptFile = Paths.get("").toAbsolutePath().toString() + File.separatorChar + "target"
47 | + File.separatorChar + "classes" + File.separatorChar + "DynamicAccount.rb";
48 |
49 |
50 | Arunachal(AccountingBean bean) {
51 | this.accountingBean = bean;
52 | }
53 |
54 | public void displayAndPatch() {
55 |
56 | try {
57 | if (!update) {
58 |
59 | // demonstration of a dynamic patch or update to an enterprise application
60 | // can also be used to build dynamic plugin, extensions based applications
61 |
62 | // XXX Step 01: Read Dynamic Updates from FileSystem
63 | // (In Real-World, Possibly from a Network Stream)
64 | System.out.println("Account Information - Original File");
65 | System.out.println("===================================");
66 | this.accountingBean.displayAccountInformation();
67 | System.out.print("Receiving Dynamic Updates from Server...");
68 | File file = new File(scriptFile);
69 |
70 | FileReader reader = new FileReader(file);
71 | char cbuf[] = new char[100000];
72 | reader.read(cbuf, 0, (int)file.length());
73 | String line = new String(cbuf);
74 |
75 | line=line.replaceAll("300", "400");
76 | line=line.replaceAll("499", "299");
77 | line=line.replaceAll("M/S. Spring in Action", "M/S. Spring in Action(Offer)");
78 | line=line.trim();
79 |
80 | // XXX Step 02: Delete the Read File (For Convenience, Deleting the File and Re-Creating)
81 | // (In Real-World, there may be an Intelligent File Update/Patch Mechanism)
82 | reader.close();
83 | file.delete();
84 |
85 |
86 | // XXX Step 02: Delete the Read File (For Convenience, Deleting the File and Re-Creating)
87 | file = new File(scriptFile);
88 | file.createNewFile();
89 | BufferedWriter writer = new BufferedWriter(new FileWriter(file));
90 | writer.write(line);
91 | writer.flush();
92 | writer.close();
93 | System.out.println(" Patched Accounting System Ver 1.3");
94 | System.out.println("----------------------------------");
95 | System.out.println("Spring-Script Magic Show");
96 | System.out.println("------------------------");
97 |
98 | Thread.currentThread().sleep(1000);
99 | update = true;
100 |
101 |
102 | // XXX Step 03: Re-Read the File Into a Character Buffer and Print on Console
103 | file = new File(scriptFile);
104 | reader = new FileReader(file);
105 |
106 | cbuf = new char[100000];
107 | reader.read(cbuf, 0, (int)file.length());
108 | line = new String(cbuf);
109 |
110 | System.out.println("********** File Contents After Patch/Update **********");
111 | System.out.println("######################################################");
112 | System.out.println(line);
113 | } else {
114 |
115 | System.out.println("Account Information - Patched/Updated");
116 | System.out.println("=====================================");
117 | this.accountingBean.displayAccountInformation();
118 | }
119 | } catch(Exception e) {
120 | e.printStackTrace();
121 | }
122 | }
123 |
124 | public static void main(String args[]) {
125 |
126 | System.out.println("Copyright (c) 2018-19, Sumith Kumar Puri");
127 | System.out.println();
128 | System.out.println("Project Codename Arunachal");
129 | System.out.println("Project Description Core Spring (Dynamic Languages)");
130 | System.out.println("Certification Brainbench Spring 2.5 Certification");
131 | System.out.println("Certificate URL https://goo.gl/X321kd");
132 | System.out.println("[Developer Notes] [01] Use Java Version 9.0+ Compiler");
133 | System.out.println();
134 |
135 | AbstractRefreshableApplicationContext ctx = new ClassPathXmlApplicationContext("accounting.xml");
136 | Arunachal accountingMain = new Arunachal((AccountingBean) ctx.getBean("accountingbean"));
137 |
138 | accountingMain.displayAndPatch();
139 |
140 | ctx.refresh();
141 |
142 | for(int i=0;i<1000000;i++); //poll
143 | for(int i=0;i<1000000;i++); //poll
144 | for(int i=0;i<1000000;i++); //poll
145 |
146 | accountingMain = new Arunachal((AccountingBean) ctx.getBean("accountingbean"));
147 |
148 | accountingMain.displayAndPatch();
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/src/main/resources/DynamicAccount.rb:
--------------------------------------------------------------------------------
1 | =begin
2 | /**
3 | * MIT License
4 | *
5 | * Copyright (c) 2018-19, Sumith Kumar Puri
6 |
7 | * GitHub URL https://github.com/sumithpuri
8 | * Code Sample Brainbench Spring 2.5 Certification [+ Spring In Action Samples]
9 | * Sample Topic Core Spring (Dynamic Languages)
10 | * Certificate URL https://goo.gl/X321kd
11 | * Package Prefix me.sumithpuri.github.arunachal
12 | * Project Codename arunachal
13 | * Contact E-Mail code@sumithpuri.me
14 | * Contact WhatsApp +91 9591497974
15 | *
16 | *
17 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
18 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
19 | * rights to use, copy, modify, merge, publish, distribute, sub-license and/or sell copies of the Software and to permit
20 | * persons to whom the Software is furnished to do so, subject to the following conditions:
21 | *
22 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
23 | * Software.
24 | *
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
27 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 | */
30 | =end
31 | class Account
32 | def id
33 | @id=300
34 | end
35 |
36 | def amt
37 | @amt=499
38 | end
39 |
40 | def getAccountId
41 | puts "RETURNING ACCOUNT ID FROM ACCOUNT"
42 | return id
43 | end
44 |
45 | def getAccountName
46 | return "Spring"
47 | end
48 |
49 | def getAccountAmt
50 | return amt
51 | end
52 |
53 | def destroy
54 | end
55 | end
56 |
--------------------------------------------------------------------------------
/DynamicAccount.rb:
--------------------------------------------------------------------------------
1 | =begin
2 | /**
3 | * MIT License
4 | *
5 | * Copyright (c) 2018-19, Sumith Kumar Puri
6 |
7 | * GitHub URL https://github.com/sumithpuri
8 | * Code Sample Brainbench Spring 2.5 Certification [+ Spring In Action Samples]
9 | * Sample Topic Core Spring (Dynamic Languages)
10 | * Certificate URL https://goo.gl/X321kd
11 | * Package Prefix me.sumithpuri.github.arunachal
12 | * Project Codename arunachal
13 | * Contact E-Mail code@sumithpuri.me
14 | * Contact WhatsApp +91 9591497974
15 | *
16 | *
17 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
18 | * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
19 | * rights to use, copy, modify, merge, publish, distribute, sub-license and/or sell copies of the Software and to permit
20 | * persons to whom the Software is furnished to do so, subject to the following conditions:
21 | *
22 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
23 | * Software.
24 | *
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26 | * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
27 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 | */
30 | =end
31 | class Account
32 | def id
33 | @id=400
34 | end
35 |
36 | def amt
37 | @amt=299
38 | end
39 |
40 | def getAccountId
41 | puts "RETURNING ACCOUNT ID FROM ACCOUNT"
42 | return id
43 | end
44 |
45 | def getAccountName
46 | return "Spring"
47 | end
48 |
49 | def getAccountAmt
50 | return amt
51 | end
52 | end
53 | Account.new
54 |
--------------------------------------------------------------------------------